SDL Color Keying Question

Started by
0 comments, last by link3333 15 years, 11 months ago
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]
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.

This topic is closed to new replies.

Advertisement