Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Color Table

marshallc
Beginner
885 Views
Hey all,
Does anyone know where I could get my hands on some sort of table that provides a listing of the colors that are available and what the numbers are for those colors?
I'm working with the following:
wc%hbrBackground = ( COLOR_WINDOW+1 )
This is the background setting for the window class. All I have found out from the description is that COLOR_WINDOW = 5... which some how equals the color gray. How? Also, there is an example that says that 6 equals white. If I wanted to change the background to red, there is nothing for me to reference to for the number.
Does anyone by chance have a table that provides the colors and the numbers used in this?
Regards,
Chad
0 Kudos
4 Replies
Paul_Curtis
Valued Contributor I
886 Views
wc%hbrBackground is a handle to a brush structure, and in the case of your example, equated to a pre-existing handle available as a system utility for one of the standard system colors. To generalize this process,
INTEGER :: hbrush,mycolor,redvalue,greenvalue,bluevalue
mycolor = RGB(redvalue,greenvalue,bluevalue)
hbrush = CreateSolidBrush (mycolor)
wc%hbrBackground = hbrush
and don't forget to delete hbrush when you're done with it.
0 Kudos
marshallc
Beginner
886 Views
Thanks, Paul-Curtis. Do you knowif there is atable that provides the different colors and the RGB components? In the little programming that I have done, I'm used to just supplying a word (ie, YELLOW) and the object gets painted that color. Is there a table or method that other developers use to determine the RGB values for the color to be used?
0 Kudos
durisinm
Novice
886 Views
You get the color you want by blending shades of red, green, and blue. You have to know how much of each color to get your desired color.

This URL might help you (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctRGB.asp). It's from the Visual Basic.NET portion of Microsoft's MSDN, but it includes a chart giving the RGB values for some common colors.

Mike D.
0 Kudos
bearoflittlebrain_ol
886 Views
If you do a Google Search using the words 'HTML' and 'Color' you will get the 216 HTML colours specified by a number of sites. I personally use an old version of the HTML colours with only 140 members that have names as well as RGB numbers. The names start off: ALICEBLUE, ANTIQUEWHITE, AQUA, etc and I have written a module CVFColours that enables them to be called by name. It also turns the RGB numbers round to the BGR order used by CVF Fortran. If you or anyone else would like a copy of this, ask me on
HTH
Alan
0 Kudos
Reply