A header file for colours.

Call me nuts, but I was fed up with specifying vectors for colours and then one fine day intelligence dawned!

I figured why not convert the HTML colour constants to RGB values and store them in a header file with their OpenGL names of course.

Now if you want red

you have glLightfv(GL_LIGHT0,GL_DIFFUSE,red);

just #include<colour.h>

Its a great convenience.

(PS. Sorry if this work has already been done)

just mail me at


for the file. Its free!

Yeah, I got fed up with writing 3.1415926535897932384626433832795 all the time, and had a brain wave…why not use the C preprocessor command #define.
So I came up with a header called pi.h
If you want it, email me on waste@mytime.com

ill be glad to have your pi.h, I have a program in which I have to write 3.1415926535897932384626433832795 for 51 times.
Please email me it on dontpost@advanceforum.com :smiley:

OMG I would have never thought of this! Geniuses you are.

BAHAHAHAHA! :smiley:


I think that its not appropriate to post this kind of things to Advanced forum.

certainly not, but this time it ended up
having a great entertainment value :smiley:

by the way: M_PI (M_PI_2, M_PI_4), M_E and some
other constants can be found in math.h …

Yeah, with small trick… At least in MSVC

Snippet from math.h

/* Define _USE_MATH_DEFINES before including math.h to expose these macro
 * definitions for common math constants.  These are placed under an #ifdef
 * since these commonly-defined names are not part of the C/C++ standards.

AFAIK, Nvidia SDK files included M_■■ definitions with higher precision. I allways wondered why, if everything is droped down to float, multiplied via float arithmetic x times and is ruinded via z precision…