Jump to content
  • Advertisement
Sign in to follow this  
NUCLEAR RABBIT

SDL Color Keying Question

This topic is 3719 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

Hello, So Im on Lesson 5 of Lazy Foo's SDL tutorials and I have come across a problem. When you make an image and you want to make a specific color transparent, how do you get the RGB numbers (ex: 0, 0xFF, 0xFF) for a specific color if I am making the image in paint or something? Thanks for any help [smile]

Share this post


Link to post
Share on other sites
Advertisement
If you go into the custom colors dialog in Paint, you can see the red, blue, and green (RGB) values of the color. The numbers in the boxes ranges from 0 to 255. A common way for representing colors is a series of 6 hexidecimal digits, or 3 pairs. A hexidecimal digit can be from 0 to F ( 9 is followed by A ). This is because hex is in base-16 rather than base-10. So 0x00 would be 0, but 0xFF would be 255. "0x" denotes the use of hex. You could look at the RGB values of the color you want then use some hex to decimal converter online, but probably the easiest way is to just use those RGB values in the function call. Whether it's hex or decimal, they are still the same value, just a different representation.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!