Sign in to follow this  

GLColors.h

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

// to be used with glColor3ubv(const GLbyte *v); // enjoy... // Whites... const static GLbyte Snow1[] ={255,250,250}; const static GLbyte Snow2[] ={238,233,233}; const static GLbyte Snow3[] ={205,201,201}; const static GLbyte Snow4[] ={139,137,137}; const static GLbyte GhostWhite[] ={248,248,255}; const static GLbyte WhiteSmoke[] ={245,245,245}; const static GLbyte Gainsboro[] ={220,220,220}; const static GLbyte FloralWhite[] ={255,250,240}; const static GLbyte OldLace[] ={253,245,230}; const static GLbyte Linen[] ={240,240,230}; const static GLbyte AntiqueWhite1[] ={250,235,215}; const static GLbyte AntiqueWhite2[] ={238,223,204}; const static GLbyte AntiqueWhite3[] ={205,192,176}; const static GLbyte AntiqueWhite4[] ={139,131,120}; const static GLbyte PapayaWhip[] ={255,239,213}; const static GLbyte BlanchedAlmond[] ={255,235,205}; const static GLbyte Bisque1[] ={255,228,196}; const static GLbyte Bisque2[] ={238,213,183}; const static GLbyte Bisque3[] ={205,183,158}; const static GLbyte Bisque4[] ={139,125,107}; const static GLbyte PeachPuff1[] ={255,218,185}; const static GLbyte PeachPuff2[] ={238,203,173}; const static GLbyte PeachPuff3[] ={205,175,149}; const static GLbyte PeachPuff4[] ={139,119,101}; const static GLbyte NavajoWhite[] ={255,222,173}; const static GLbyte Moccasin[] ={255,228,181}; const static GLbyte Cornsilk1[] ={255,248,220}; const static GLbyte Cornsilk2[] ={238,232,205}; const static GLbyte Cornsilk3[] ={205,200,177}; const static GLbyte Cornsilk4[] ={139,136,120}; const static GLbyte Ivory1[] ={255,255,240}; const static GLbyte Ivory2[] ={238,238,224}; const static GLbyte Ivory3[] ={205,205,193}; const static GLbyte Ivory4[] ={139,139,131}; const static GLbyte LemonChiffon[] ={255,250,205}; const static GLbyte Seashell1[] ={255,245,238}; const static GLbyte Seashell2[] ={238,229,222}; const static GLbyte Seashell3[] ={205,197,191}; const static GLbyte Seashell4[] ={139,134,130}; const static GLbyte Honeydew1[] ={240,255,240}; const static GLbyte Honeydew2[] ={244,238,224}; const static GLbyte Honeydew3[] ={193,205,193}; const static GLbyte Honeydew4[] ={131,139,131}; const static GLbyte MintCream[] ={245,255,250}; const static GLbyte Azure[] ={240,255,255}; const static GLbyte AliceBlue[] ={240,248,255}; const static GLbyte Lavender[] ={230,230,250}; const static GLbyte LavenderBlush[] ={255,240,245}; const static GLbyte MistyRose[] ={255,228,225}; const static GLbyte White[] ={255,255,255}; // Grays... const static GLbyte Black[] ={0,0,0}; const static GLbyte DarkSlateGray[] ={49,79,79}; const static GLbyte DimGray[] ={105,105,105}; const static GLbyte SlateGray[] ={112,138,144}; const static GLbyte LightSlateGray[] ={119,136,153}; const static GLbyte Gray[] ={190,190,190}; const static GLbyte LightGray[] ={211,211,211}; // Blues... const static GLbyte MidnightBlue[] ={25,25,112}; const static GLbyte Navy[] ={0,0,128}; const static GLbyte CornflowerBlue[] ={100,149,237}; const static GLbyte DarkSlateBlue[] ={72,61,139}; const static GLbyte SlateBlue[] ={106,90,205}; const static GLbyte MediumSlateBlue[] ={123,104,238}; const static GLbyte LightSlateBlue[] ={132,112,255}; const static GLbyte MediumBlue[] ={0,0,205}; const static GLbyte RoyalBlue[] ={65,105,225}; const static GLbyte Blue[] ={0,0,255}; const static GLbyte DodgerBlue[] ={30,144,255}; const static GLbyte DeepSkyBlue[] ={0,191,255}; const static GLbyte SkyBlue[] ={135,206,250}; const static GLbyte LightSkyBlue[] ={135,206,250}; const static GLbyte SteelBlue[] ={70,130,180}; const static GLbyte LightSteelBlue[] ={176,196,222}; const static GLbyte LightBlue[] ={173,216,230}; const static GLbyte PowderBlue[] ={176,224,230}; const static GLbyte PaleTurquoise[] ={175,238,238}; const static GLbyte DarkTurquoise[] ={0,206,209}; const static GLbyte MediumTurquoise[] ={72,209,204}; const static GLbyte Turquoise[] ={64,224,208}; const static GLbyte Cyan[] ={0,255,255}; const static GLbyte LightCyan[] ={224,255,255}; const static GLbyte CadetBlue[] ={95,158,160}; // Greens... const static GLbyte MediumAquamarine[] ={102,205,170}; const static GLbyte Aquamarine[] ={127,255,212}; const static GLbyte DarkGreen[] ={0,100,0}; const static GLbyte DarkOliveGreen[] ={85,107,47}; const static GLbyte DarkSeaGreen[] ={143,188,143}; const static GLbyte SeaGreen[] ={46,139,87}; const static GLbyte MediumSeaGreen[] ={60,179,113}; const static GLbyte LightSeaGreen[] ={32,178,170}; const static GLbyte PaleGreen[] ={152,251,152}; const static GLbyte SpringGreen[] ={0,255,127}; const static GLbyte LawnGreen[] ={124,252,0}; const static GLbyte Chartreuse[] ={127,255,0}; const static GLbyte MediumSpringGreen[] ={0,250,154}; const static GLbyte GreenYellow[] ={173,255,47}; const static GLbyte LimeGreen[] ={50,205,50}; const static GLbyte YellowGreen[] ={154,205,50}; const static GLbyte ForestGreen[] ={34,139,34}; const static GLbyte OliveDrab[] ={107,142,35}; const static GLbyte DarkKhaki[] ={189,183,107}; const static GLbyte Khaki[] ={240,230,140}; // Yellows... const static GLbyte PaleGoldenrod[] ={238,232,170}; const static GLbyte LightGoldenrodYellow[] ={250,250,210}; const static GLbyte LightYellow[] ={255,255,224}; const static GLbyte Yellow[] ={255,255,0}; const static GLbyte Gold[] ={255,215,0}; const static GLbyte LightGoldenrod[] ={238,221,130}; const static GLbyte Goldenrod[] ={218,165,32}; const static GLbyte DarkGoldenrod[] ={184,134,11}; // Browns... const static GLbyte RosyBrown[] ={188,143,143}; const static GLbyte IndianRed[] ={205,92,92}; const static GLbyte SaddleBrown[] ={139,69,19}; const static GLbyte Sienna[] ={160,82,45}; const static GLbyte Peru[] ={205,133,63}; const static GLbyte Burlywood[] ={222,184,135}; const static GLbyte Beige[] ={245,245,220}; const static GLbyte Wheat[] ={245,222,179}; const static GLbyte SandyBrown[] ={244,164,96}; const static GLbyte Tan[] ={210,180,140}; const static GLbyte Chocolate[] ={210,105,30}; const static GLbyte Firebrick[] ={178,34,34}; const static GLbyte Brown[] ={165,42,42}; // Oragnes... const static GLbyte DarkSalmon[] ={233,150,122}; const static GLbyte Salmon[] ={250,128,114}; const static GLbyte LightSalmon[] ={255,160,122}; const static GLbyte Orange[] ={255,165,0}; const static GLbyte DarkOrange[] ={255,140,0}; const static GLbyte Coral[] ={255,127,80}; const static GLbyte LightCoral[] ={240,128,128}; const static GLbyte Tomato[] ={255,99,71}; const static GLbyte OrangeRed[] ={255,69,0}; const static GLbyte Red[] ={255,0,0}; // Pinks/Violets... const static GLbyte HotPink[] ={255,105,180}; const static GLbyte DeepPink[] ={255,20,147}; const static GLbyte Pink[] ={255,192,203}; const static GLbyte LightPink[] ={255,182,193}; const static GLbyte PaleVioletRed[] ={219,112,147}; const static GLbyte Maroon[] ={176,48,96}; const static GLbyte MediumVioletRed[] ={199,21,133}; const static GLbyte VioletRed[] ={208,32,144}; const static GLbyte Violet[] ={238,130,238}; const static GLbyte Plum[] ={221,160,221}; const static GLbyte Orchid[] ={218,112,214}; const static GLbyte MediumOrchid[] ={186,85,211}; const static GLbyte DarkOrchid[] ={153,50,204}; const static GLbyte DarkViolet[] ={148,0,211}; const static GLbyte BlueViolet[] ={138,43,226}; const static GLbyte Purple[] ={160,32,240}; const static GLbyte MediumPurple[] ={147,112,219}; const static GLbyte Thistle[] ={216,191,216};

Share this post


Link to post
Share on other sites
ok...............It would be better if they were floats since the linker changes -OTHER- data types into floats. That is how OpenGL works. It would also be better if you have a color class so that the user could make custom colors.

Share this post


Link to post
Share on other sites
Quote:
Original post by Khaosifix
ok...............It would be better if they were floats since the linker changes -OTHER- data types into floats. That is how OpenGL works. It would also be better if you have a color class so that the user could make custom colors.


the linker wont change bytes to floats on you, the colors will be passed to openGL as bytes.

Share this post


Link to post
Share on other sites
Uhm, it's called a script. As in, a script that takes the HTML color list and converts them to floating point values with 3 or 4 digits, and then names them how you like.

If you did that by hand, you have way too much free time:P.

Share this post


Link to post
Share on other sites
Quote:
Original post by virtuacasper
i thought it may help people who are new to opengl like me...
(dave astle & kevin hawkins-> fantasic book!)

in future i wont bother...


Dave Astle and Kevin Hawkins happen to be people not books....They are the CEO of this very site and are also book authors. If you're referring to "OpenGL Game Programming" or "Beginning OpenGL Game Programmer" then I'll have to disagree with you and say that they are both below average books.

Share this post


Link to post
Share on other sites
Quote:
Original post by virtuacasper
i thought it may help people who are new to opengl like me...
(dave astle & kevin hawkins-> fantasic book!)

in future i wont bother...


No it's nice, don't get down over it, some people like to downplay others...

As for the book, I think it's decent but I would really recommend the red book.

Share this post


Link to post
Share on other sites
Isn't it a bit of memory waiste? I mean, who would use all these colors in a single app? I think you should make an image displaying all the colors with their names, so we at least know wich color we're using eh...

Indeed, the OpenGL Game Programming books are bad (it's allways: that's not in the scope of this book so whe won't cover it, and it says that about too much things), the redbook is waay better to learn OpenGL, but sadly enough I don't have it.

Share this post


Link to post
Share on other sites
Quote:
Original post by LordMyth
Isn't it a bit of memory waiste? I mean, who would use all these colors in a single app? I think you should make an image displaying all the colors with their names, so we at least know wich color we're using eh...


If its not used in the problem it wont get compiled into the final exe...

Share this post


Link to post
Share on other sites
I don't think the static has anything to do with it, it just doesn't get compiled in if it isn't used.

And anyway it's just a few hundred bytes, unless you have some severe memory restrictions it's not going to be a problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by Monder
I don't think the static has anything to do with it, it just doesn't get compiled in if it isn't used.


thats pretty much it, in C++ anything you dont use doesnt get compiled/linked into the final exe (certainly with any mildly recent C++ compiler)

Share this post


Link to post
Share on other sites
Something tells me you haven't fiddled around in C enough. ;)


typedef GLubyte GLucolor[3]; //give it a better name if you want

#define makeGLucolor(name,r,g,b) const static GLucolor name = {r,g,b};

makeGLucolor(Snow1,255,250,250);
makeGLucolor(Snow2,238,233,233);
//and so on...

#undef makeGLucolor //not needed now



If nothing else, at least it'll make the file that contains the list of colours smaller.

None the less, this could be useful, 'specially for people like me that are too lazy to go make up a texture to bind to objects.

If you wanted to take it one step further, you could always make up a texture, load it into memory, and just use all of the names as indexes to pixels in the image.

Also, isn't snow a little more blue than it is red? ;)

Share this post


Link to post
Share on other sites
@LordMyth: the red book is available online for free (and its legal) so i dont think its that sad
@Gorax: another way to do it, is to write the colors like this:
Linen 240 240 230 or 240,240,230
and write a small script to convert it to C

I'm sure that if (or when) i'll use it, i would remember only a couple words but I still think its nice.
So the next colors thingy that can be made can be a colors tool.
we'll choose the color we want and a textbox will show us the array we are looking for. and then we just copy it to clipboard by clicking on some button (no ctrl+c, i mean a button inside the tool, near the textbox).

pex.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I have free version of opengl redbook v1.1, exists a new versio ?? which is the new version and where I can get/buy it ?

Share this post


Link to post
Share on other sites

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