Sign in to follow this  

SDL Color Keying Question

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

This topic is 3497 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this