# RGB to HEX

**URL:** https://forum.kirupa.com/t/rgb-to-hex/144110
**Category:** Uncategorized
**Created:** [April 11, 2005, 9:24pm UTC](https://forum.kirupa.com/t/rgb-to-hex/144110 "2005-04-11T21:24:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![daffodill](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@daffodill](https://forum.kirupa.com/u/daffodill)
#### Post date: [April 11, 2005, 9:24pm UTC](https://forum.kirupa.com/t/rgb-to-hex/144110/1 "2005-04-11T21:24:18Z")

</div>

i have 3 numbers ( r, g , b ) …  
how do i get a number which is HEX equivalent ???  
color : Number = r\<\<16 | g\<\<8 | b  
is giving me something, which i am not sure if it is HEx
