Jump to content
  • Advertisement
Sign in to follow this  
Chief_Voyager

converting RGB values to hex

This topic is 5101 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
0 in ints is equivalent 00 hex, 16 int == f hex, 255 int == ff hex. you can enter the value in int you want in hex the windows calculator and click the numeric type to hex and it will change it for you :) hope that helps, Klaus.

Share this post


Link to post
Share on other sites
RGB value hold 3 bytes, one for Red, one for Green and one for Blue component of the color. To help with the hex 0 is 00 and 255 is FF.
Some examples:

RGB(255, 0, 0) = $0000FF. // full red, FF-> indicates 255 in red

RGB(0, 255, 0) = $00FF00. // full green, FF-> indicates 255 in green

RGB(0, 0, 255) = $FF0000. // full blue, FF-> indicates 255 in blue

RGB(128, 128, 0) = $008080

etc

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!