About colors - sytem colors code and real associated colors

Hi

In some of our DW, we change the background color of every alternate row to
make the DW more readable (huge list)
The main color is 'windows backgroud' ( = 1073741824) , and the alternate
color is "a_little_bit_more_grey_than_windows_background"

The thing is : to define alternate color, I need to know the RGB value of
'windows background'. At the moment, i take this value from the registries,
but I cannot really trust that method as users could have a different
registry setting ( you never know...). I had a problem on a test machine
where the windows colors were NEVER modified : the registry key was empty
!!!

Is there an API call or another method to get the RGB definition of a
'system color' without fiddling ?

Thanks

Philip


0
Philip
12/10/1998 9:30:18 AM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

3 Replies
985 Views

Similar Articles

[PageSpeed] 21

Hi Philip,

These are the instance variables in the pfc_n_cst_color object in the
pfcapsrv.pbl that ships with PowerBuilder:

constant long BUTTONFACE =  78682240
constant long WINDOW_BACKGROUND = 1087434968
constant long WINDOW_TEXT = 33554592
constant long APPLICATION_WORKSPACE = 268435456
constant long TRANSPARENT = 553648127

constant long BLACK = RGB(0, 0, 0)
constant long WHITE = RGB(255, 255, 255)
constant long LIGHT_GRAY = RGB(192, 192, 192)
constant long DARK_GRAY = RGB(128, 128, 128)
constant long RED = RGB(255, 0, 0)
constant long DARK_RED = RGB(128, 0, 0)
constant long GREEN = RGB(0, 255, 0)
constant long DARK_GREEN = RGB(0, 128, 0)
constant long BLUE = RGB(0, 0, 255)
constant long DARK_BLUE = RGB(0, 0, 128)
constant long MAGENTA = RGB(255, 0, 255)
constant long DARK_MAGENTA = RGB(128, 0, 128)
constant long CYAN = RGB(0, 255, 255)
constant long DARK_CYAN = RGB(0, 128, 128)
constant long YELLOW = RGB(255, 255, 0)
constant long BROWN = RGB(128, 128, 0)

Rick

Philip Sidgwick <sidgwickNOSPAM@usa.NOSPAM.net> wrote in article
<x7vMZXBJ#GA.327@forums.powersoft.com>...
> Hi
> 
> In some of our DW, we change the background color of every alternate row
to
> make the DW more readable (huge list)
> The main color is 'windows backgroud' ( = 1073741824) , and the alternate
> color is "a_little_bit_more_grey_than_windows_background"
> 
> The thing is : to define alternate color, I need to know the RGB value of
> 'windows background'. At the moment, i take this value from the
registries,
> but I cannot really trust that method as users could have a different
> registry setting ( you never know...). I had a problem on a test machine
> where the windows colors were NEVER modified : the registry key was empty
> !!!
> 
> Is there an API call or another method to get the RGB definition of a
> 'system color' without fiddling ?
> 
> Thanks
> 
> Philip
> 
> 
> 
0
Rick
12/10/1998 11:53:07 AM
thanks, but my question is more specific

How can I tell which is the real RGB color mapped with WINDOW_BACKGROUND ?
Is it white, pale green, orange ? I need the link between the windows color
code, and the real color displayed.


Rick Seeley wrote in message
<01be243d$32db7240$3e0c6480@w15-1268.rmoc.on.ca>...
>Hi Philip,
>
>These are the instance variables in the pfc_n_cst_color object in the
>pfcapsrv.pbl that ships with PowerBuilder:
>
>constant long BUTTONFACE =  78682240
>constant long WINDOW_BACKGROUND = 1087434968
>constant long WINDOW_TEXT = 33554592
>constant long APPLICATION_WORKSPACE = 268435456
>constant long TRANSPARENT = 553648127
>
>constant long BLACK = RGB(0, 0, 0)
>constant long WHITE = RGB(255, 255, 255)
>constant long LIGHT_GRAY = RGB(192, 192, 192)
>constant long DARK_GRAY = RGB(128, 128, 128)
>constant long RED = RGB(255, 0, 0)
>constant long DARK_RED = RGB(128, 0, 0)
>constant long GREEN = RGB(0, 255, 0)
>constant long DARK_GREEN = RGB(0, 128, 0)
>constant long BLUE = RGB(0, 0, 255)
>constant long DARK_BLUE = RGB(0, 0, 128)
>constant long MAGENTA = RGB(255, 0, 255)
>constant long DARK_MAGENTA = RGB(128, 0, 128)
>constant long CYAN = RGB(0, 255, 255)
>constant long DARK_CYAN = RGB(0, 128, 128)
>constant long YELLOW = RGB(255, 255, 0)
>constant long BROWN = RGB(128, 128, 0)
>
>Rick
>
>Philip Sidgwick <sidgwickNOSPAM@usa.NOSPAM.net> wrote in article
><x7vMZXBJ#GA.327@forums.powersoft.com>...
>> Hi
>>
>> In some of our DW, we change the background color of every alternate row
>to
>> make the DW more readable (huge list)
>> The main color is 'windows backgroud' ( = 1073741824) , and the alternate
>> color is "a_little_bit_more_grey_than_windows_background"
>>
>> The thing is : to define alternate color, I need to know the RGB value of
>> 'windows background'. At the moment, i take this value from the
>registries,
>> but I cannot really trust that method as users could have a different
>> registry setting ( you never know...). I had a problem on a test machine
>> where the windows colors were NEVER modified : the registry key was empty
>> !!!
>>
>> Is there an API call or another method to get the RGB definition of a
>> 'system color' without fiddling ?
>>
>> Thanks
>>
>> Philip
>>
>>
>>


0
Philip
12/10/1998 1:19:02 PM
Philip,

Have a look at the GetSysColors Widows API function.

HTH,
Greg

--
______________________________
Gregory R. George
Greg_George@AscensionLabs.com
Ascension Labs, LLC
www.AscensionLabs.com

Philip Sidgwick wrote in message <8ux0NXDJ#GA.321@forums.powersoft.com>...
>thanks, but my question is more specific
>
>How can I tell which is the real RGB color mapped with WINDOW_BACKGROUND ?
>Is it white, pale green, orange ? I need the link between the windows color
>code, and the real color displayed.
>
>
>Rick Seeley wrote in message
><01be243d$32db7240$3e0c6480@w15-1268.rmoc.on.ca>...
>>Hi Philip,
>>
>>These are the instance variables in the pfc_n_cst_color object in the
>>pfcapsrv.pbl that ships with PowerBuilder:
>>
>>constant long BUTTONFACE =  78682240
>>constant long WINDOW_BACKGROUND = 1087434968
>>constant long WINDOW_TEXT = 33554592
>>constant long APPLICATION_WORKSPACE = 268435456
>>constant long TRANSPARENT = 553648127
>>
>>constant long BLACK = RGB(0, 0, 0)
>>constant long WHITE = RGB(255, 255, 255)
>>constant long LIGHT_GRAY = RGB(192, 192, 192)
>>constant long DARK_GRAY = RGB(128, 128, 128)
>>constant long RED = RGB(255, 0, 0)
>>constant long DARK_RED = RGB(128, 0, 0)
>>constant long GREEN = RGB(0, 255, 0)
>>constant long DARK_GREEN = RGB(0, 128, 0)
>>constant long BLUE = RGB(0, 0, 255)
>>constant long DARK_BLUE = RGB(0, 0, 128)
>>constant long MAGENTA = RGB(255, 0, 255)
>>constant long DARK_MAGENTA = RGB(128, 0, 128)
>>constant long CYAN = RGB(0, 255, 255)
>>constant long DARK_CYAN = RGB(0, 128, 128)
>>constant long YELLOW = RGB(255, 255, 0)
>>constant long BROWN = RGB(128, 128, 0)
>>
>>Rick
>>
>>Philip Sidgwick <sidgwickNOSPAM@usa.NOSPAM.net> wrote in article
>><x7vMZXBJ#GA.327@forums.powersoft.com>...
>>> Hi
>>>
>>> In some of our DW, we change the background color of every alternate row
>>to
>>> make the DW more readable (huge list)
>>> The main color is 'windows backgroud' ( = 1073741824) , and the
alternate
>>> color is "a_little_bit_more_grey_than_windows_background"
>>>
>>> The thing is : to define alternate color, I need to know the RGB value
of
>>> 'windows background'. At the moment, i take this value from the
>>registries,
>>> but I cannot really trust that method as users could have a different
>>> registry setting ( you never know...). I had a problem on a test machine
>>> where the windows colors were NEVER modified : the registry key was
empty
>>> !!!
>>>
>>> Is there an API call or another method to get the RGB definition of a
>>> 'system color' without fiddling ?
>>>
>>> Thanks
>>>
>>> Philip
>>>
>>>
>>>
>
>


0
Gregory
12/10/1998 3:58:43 PM
Reply:

Similar Artilces:

color problem ? panel1.BackColor = Drawing.Color.Crimson.. how can i write #CC0000 of color as code line ?
hi friends i can change color of panel1.. but how can i use #CC0000 of color format ???  panel1.BackColor = Drawing.Color.Crimson how can i write #CC0000 of color as code line ? cheers Mark as me if my question or my answer can be helpful for you :) like this panel1.BackColor = System.Drawing.ColorTranslator.FromHtml("#cc0000")Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/...

C# Graphics.Clear(Color color) did not update color!
Hi, I have code that resizes an image and fills border spaces with certain color. This works fine, but when i changed the original color to a different one it still fills it with the original color. I rebuilt and built my project to try and get it to update right, but it still uses the original color. Any suggestions will be very much appreciated. E  Are you using any dll for doing that. If so mention the dll name , you can post your code here not the full one the part where there is a trouble.usually the syntax "Graphics.fill(Color color)" to update c...

Color by color in DataList
I use the DataList, and I want to set the background color in each item in a random way, anybody help me ? Thank in advancedMSN: unfriendlyboy@hotmail.comASP.NET fan. You can set the background color of items in the DataList in ItemCreated. This method is called as each item is created. Within your ItemCreated method, you can use e.Item.BackColor to set the background color. To randomize the colors, take a look at the Random class. You'd probably want to use one of the "Next" overrides to generate your color number or numbers.JimMS MVP ASP.NET [VC++/MFC emeritus]Old Dog Lea...

Where I can find color code for all colors?
Silly questions: Try to do some change in the stylesheet file, but don't know where I can find color code for all colors. So can anyone help? Please!! Have a blessed day. lz74d I use this page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebgen/html/X11_hue.asp Hope That HelpsAll that wander, are not lost...What were we talkin bout Hey its a great link !!!! specially that i have a problem with colors !!!!Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP...

How to get the color name when i have a Hex color code
Hi all,I would like to get the color name for example when i am given a hex color codeEg.Private Sub Page_Load()'Return BlackDim strColorName As String = Color.FromName("FFFFFF").Name.toString()'I always keeping getting FFFFFF instead of the word black.Response.Write(strColorName)End SubKaren Have a look at Color.ToKnownColor(). This will return a value of the KnownColor enumeration, on which you then call the ToString() method. The problem is that not all possible hex color codes have a known name (you'd need roughly 16.7 million names for all combinations!). Also, I assume you're n...

how to set brushes.color from a color code (#d2d2d2)
 Hi,Currently in my code I set my brush color by going fontColor = Brushes.Red  Is there a way I can set the color from a font color code such as #d2d2d2 ? Thanks very much! mike123 If you use a SolidBrush, you can declare your own color. (SolidBrush inherits the Brush class, so the SolidBrushes can be treated as Brushes) Use the ColorTranslator class to create a color from hex code.  ' Imports at the top of the page Imports System.Drawing Dim myBrush As New SolidBrush(ColorTranslator.FromHtml("#d2d2d2")) ' use the solid brush as normal. --...

How to set color dynamically using html color codes??
 Hi,I want to do something like this: theGridView.FooterStyle.BackColor="#333333" , but having trouble finding right way to do it.How can the "#333333" be converted to a Color type?Thanks!  like this   theGridView.FooterStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#333333")  Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/...

color-coding items in listbox
I am color-coding certain items in a ListBox using: item.Attributes.Add("style", "background-color : red"); // then i add item to listbox The problem is that on a postback, the items lose their color. How would i go about retaining it? If i clear the listbox and repopulate it on every pageload, i lose the item they selected in other methods. [Actually running an HTML Select as a server control since a ListBox did not work.] TIA! I recommend using Peter Brunone EasyListBox, which I believe is a great control to use: EasyListBox RegardsBilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft ...

Color converter mixes colors up
I am trying to make the colors of certain controls databound. The colors are in a database in long format. For exampleLong: 16711680which I took with a color picker and is dark blue (#0000FF)A function which I took from the net converts the long rightly to 0000FF. However:Dim converter As New System.Drawing.ColorConverterDim hiscoloris As Drawing.Color = converter.ConvertFromString(-the long value casted to int32-)Dim htmlstring As String = System.Drawing.ColorTranslator.ToHtml(hiscoloris)Dim anothercolor As Drawing.Color = System.Drawing.Color.FromArgb(hisintis)seems to reverse the string: ...

32Bit Color / 16Bit Color
Our applications uses graphs. We recently found that if the client system was set to True Color(32Bit)all graphs display without color but with various types of lines. Change the client to High Color(16 Bit) and all is well! Is there any solution other than switching the individual system to utilize 16bit color? Any help appreciated! Thanks! -- http://www.genesis-software.com jdouglas@genesis-software.com We found this too, the answer from PowerSoft was 'No'! Jim Douglas wrote in message <6ia2ss$agq@bgtnsc03.worldnet.att.net>... >Our applica...

Celendar Colors and Category Colors
Hi, using Sunbird 0.5, I wonder how I could swap the colors used for displaying the category and calendar. This means currently I get a box filled up with the color of the calendar, surrounded by a rectangle colored in the category color. I simply would like to swap both colors since I can differentiate better e.g. if this is a birthday event or a private event. For now you have to look very closely since all events look more or less the same because of the small used border with used to display the category. Is there an option for this? Thanks! -- cu, Michael On Aug 3, ...

color email does not print in color
The user is saying a color email won't print in color anyone know how to get this to work? thanks Ralph wrote: > The user is saying a color email won't print in color > > anyone know how to get this to work? > > thanks > Printer driver dependent. Most things do not print in color correctly in GW. Laugh at user, and insult. ...

firefox dose not display image colors matching coded colors
Name: Curt Doll Email: indotquiriesatcurtisgraphicsdotcom Product: Firefox Summary: firefox dose not display image colors matching coded colors Comments: firefox dose not display image colors matching coded colors - i set web coded colors on images and when i post them on the net they do not match the exact same coded colors in the body Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedba...

Coloring my own keywords, (Syntax Colors)
How can I get the editor to highligth keywords like WInt WULong... Jostein. ...

firefox dose not display image colors matching coded colors #2
Name: Curt Doll Email: indotquiriesatcurtisgraphicsdotcom Product: Firefox Summary: firefox dose not display image colors matching coded colors Comments: firefox dose not display image colors matching coded colors - i set web coded colors on images and when i post them on the net they do not match the exact same coded colors in the body Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedba...

Web resources about - About colors - sytem colors code and real associated colors - sybase.powerbuilder.general

The Meaning Of Donald Trump
In this week’s 2016 Slack Chat , we leave the horse race aside to look for meaning in Donald Trump’s romp through the world of politics. The ...

Kathy Griffin & Anderson Cooper Will Host CNN New Year’s Eve Live!
Kathy Griffin flashes a smile and waves to photographs while arriving at LAX Airport on Monday (December 28) in Los Angeles. The 55-year-old ...

Changes to Be Announced in Chicago Police Training, Tasers
Chicago mayor's office: Emanuel, police leader to announce changes in training, Taser use

‘Affluenza Teen’ Ethan Couch Had A Going Away Party With Mother’s Okay Before Fleeing To Mexico
Entitlement seems to really have its privileges. Affluenza teen Ethan Couch not only got away with vehicular manslaughter by getting probation, ...

Facebook to face class action lawsuits over claims it inflated share price
US judge approves group lawsuit over allegations that company misled investors ahead of 2012 IPO

'Glee' star arrested on suspicion of possessing child porn
Reuters 'Glee' star arrested on suspicion of possessing child porn Reuters LOS ANGELES Actor Mark Salling, star of the hit television show ...

Flooding runoff pushes rivers higher; Mississippi overtops levee in Missouri
CNN Flooding runoff pushes rivers higher; Mississippi overtops levee in Missouri CNN Are you within sight of floodwater? Share your photos, ...

Former Governor George Pataki Ends His Presidential Campaign
On Tuesday, George Pataki announced that he would be ending his presidential campaign. Pataki, who was aiming to gain the Republican nomination, ...

Northeast Gets Snow, Ice During Its 1st Winter Storm
1st winter storm brings snow, ice and reassurance to Northeast residents

New Apple iPhone rumor: Samsung/LG OLED screens ahoy. Magical!
Apple will use OLED in a future iPhone: Samsung and LG are “close to agreement” with Cupertino, we’re told. Of course, Apple is hardly the first ...

Resources last updated: 12/30/2015 12:17:25 PM