- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page