# Hexadecimal from float

**URL:** <https://forum.kirupa.com/t/hexadecimal-from-float/315078>\
**Category:** Uncategorized\
**Created:** [October 17, 2010, 4:38am UTC](https://forum.kirupa.com/t/hexadecimal-from-float/315078 "2010-10-17T04:38:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Intravenus](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@Intravenus](https://forum.kirupa.com/u/Intravenus)\
**Post date:** [October 17, 2010, 4:38am UTC](https://forum.kirupa.com/t/hexadecimal-from-float/315078/1 "2010-10-17T04:38:08Z")

</div>

I’m trying to beginFill() a shape with a gray based on a percentage or a float value between 0.0 and 1.0.  
How can I get the hex number from the float?

eg: 0.0 = black = 0x000000 , 1.0 = white = 0xffffff , 0.73 = a gray tone = ???
