[lazarus] GTK+ Theme colors

Michal Bukovjan bukovjan at mbox.dkm.cz
Mon Sep 16 16:54:18 EDT 2002


Andrew Johnson wrote:

> I could use some help on this: I can't remember what all the color 
> flags corrsepond to how Win32 Draws things and so what the proper GC 
> for them would be in GTK.

I'll try to remember some :-)

>
> The bulk of the basics I am not certain of -
>
> COLOR_WINDOW(default Window(Form) color?)
> COLOR_WINDOWTEXT(default text color?)
> COLOR_HIGHLIGHT(Isn't this the color used on selected Edits?) 

- yes, selected background

>
> COLOR_HIGHLIGHTTEXT(..selected Edits Text?) 

- yes, background of selected text

>
>
> These are ones I don't think I can get(yet) -
>
> COLOR_BACKGROUND(Is the desktop background?)
> COLOR_ACTIVECAPTION(Forefront Window Title Text color?) 

- yes, and forget about this on Linux (this is window manager thingy)

>
> COLOR_INACTIVECAPTION (background Window Title Text color?) 

- yes, and forget about this on Linux (this is window manager thingy)

>
> COLOR_ACTIVEBORDER(Forefront Window border color?) 

- yes, and forget about this on Linux (this is window manager thingy)

>
> COLOR_INACTIVEBORDER(background Window border color?) 

- yes, and forget about this on Linux (this is window manager thingy)

>
> COLOR_APPWORKSPACE (What IS this?) 

- I guess this is the color of MDI application background (when there is 
no window). Not sure how to map this.

>
>
> These I are ones I don't know what they are -
>
> COLOR_CAPTIONTEXT
> COLOR_WINDOWFRAME 

- forget about this on Linux (this is window manager thingy)

>
> COLOR_INACTIVECAPTIONTEXT
> COLOR_3DDKSHADOW
> COLOR_3DLIGHT 

Shadow. The dark is top left, light is bottom right. Used to created the 
shaded 3d effect.

>
> COLOR_INFOTEXT
> COLOR_INFOBK 

Tooltips...

>
>
> Any Feedback from anyone would be appreciated.
>
> Andrew

I recommend you look into Kylix help file. They introduced a concept of 
ColorGroups and ColorRoles, and somehow remade mappings for color.
I attach for your reference TColor, TColorGroup and TColorRole from 
Kylix 1 Help file.

Michal


TColor is used to specify the color of an object.


Unit

QGraphics

type TColor = -$7FFFFFFF-1..$7FFFFFFF;


Description

TColor is used to specify the color of an object. It is used by the Color property of many components and by a number of other properties that specify color values.

The Graphics unit contains definitions of useful constants for TColor. These constants map to either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element colors (for example, clNormalButton maps to the system color for button faces). In addition, there are a set of compatibility constants that map to system constants but have names to match system constants for the Windows-based colors.

If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green,and red, respectively. The value $00FF0000 represents full-intensity, pure blue, $0000FF00 is pure green, and $000000FF is pure red. $00000000 is black and $00FFFFFF is white.

If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context.

The following tables lists the color constants from the Graphics unit. The first two columns list the colors that map to the closest matching color in the system palette followed by the compatibility constants, while the last two columns list the system color constants. The are defined in terms of the BaseColor of the current palette.

Value			Meaning				Value			Meaning	
clNone			White.				clForeground		Base foreground color (for example, the color of lines or text). 	
clAqua			Aqua				clNormalForeground	Foreground color for enabled inactive controls.	
clBlack			Black				clDisabledForeground	Foreground color for disabled controls.	
clBlue			Blue				clActiveForeground	Foreground color for active controls.	
clDkGray		Dark Gray			clBackground		Base background color.	
clFuchsia		Fuchsia				clNormalBackground	Background color for enabled inactive controls.	
clGray			Gray				clBase			Base background color for Text controls.	
clGreen			Green				clNormalBase		Background color for enabled, inactive text controls	
clLime			Lime green			clDisabledBase		Background color for disabled text controls.	
clLtGray		Light Gray			clActiveBase		Background color for active text controls.	
clMaroon		Maroon				clText			Base Foreground color for text controls	
clNavy			Navy blue			clNormalText		Foreground color for enabled inactive text controls	
clOlive			Olive green			clDisabledText		Foreground color for disabled text controls.	
clPurple		Purple				clActiveText		Foreground color for active text controls	
clRed			Red				clButton		Base background color for button controls.	
clSilver		Silver				clNormalButton		Background color for enabled inactive button controls.	
clTeal			Teal				clDisabledButton	Background color for disabled button controls.	
clWhite			White				clActiveButton		Background color for active button controls.	
clYellow		Yellow				clButtonText		Base foreground color for button controls.	
							clNormalButtonText	Foreground color for enabled inactive button controls.	
clScrollBar		maps to clButton		clDisabledButtonText	Foreground color for disabled button controls.	
clActiveCaption		maps to clActiveHighlightedText	clActiveButtonText 	Foreground color for active button controls.	
clInactiveCaption	maps to DisabledHighlightedText	clBrightText 	Base contrasting text color	
clMenu			maps to clMid			clNormalBrightText 	Contrasting text color for enabled inactive controls.	
clWindow		maps to clBase			clDisabledBrightText 	Contrasting text color for disabled controls	
clWindowFrame		maps to clHighlight		clActiveBrightText	Contrasting text color for active controls 	
clMenuText		maps to clButtonText		clHighlight	Base color for selected or highlighted items.	
clWindowText		maps to clText			clNormalHighlight	Background color for enabled inactive selected or highlighted items.	
clCaptionText		maps to clHighlightedText	clDisabledHighlight	Background color for disabled selected or highlighted items	
clActiveBorder		maps to clActiveHighlight	clActiveHighlight	Background color for active selected or highlighted items.	
clInactiveBorder	maps to clDisabledHighlight	clHighlightedText	Base foreground color for selected or highlighted items.	
clAppWorkspace		maps to clMid			clNormalHighlightedText	Foreground color for enabled inactive selected or highlighted items.	
clBtnFace		maps to clButton		clDisabledHighlightedText	Foreground color for disabled selected or highlighted items	
clBtnShadow		maps to clDark			clActiveHighlightedText	Foreground color for active selected or highlighted items.	
clGrayText		maps to clLight			clLight			Base color for light areas in 3-D effects	
clBtnText		maps to clButtonText		clNormalLight		Light color in 3D effects on enabled inactive controls.	
clInactiveCaptionText	maps to clDisabledHighlightedText clDisabledLight	Light color in 3D effects on disabled controls.	
clBtnHighlight		maps to clBrightText		clActiveLight		Light color in 3D effects on active controls.	
cl3DDkShadow		maps to clMid			clMidlight		Base color for light (but darker than clLight) areas in 3-D effects	
cl3DLight		maps to clMidlight		clNormalMidlight	Light (but darker than clNormalLight) color in 3D effects on enabled inactive controls.	
clInfoText		maps to clText			clDisabledMidlight	Light (but darker than clDisabledLight) color in 3D effects on disabled controls.	
clInfoBk		light brown			clActiveMidlight	Light (but darker than clActiveLight) color in 3D effects on active controls.	
clHighlightText		maps to clHighlightedText	clMid			Base color for dark (but lighter than clDark) areas in 3-D effects	
							clNormalMid		Dark (but lighter than clNormalDark) color in 3D effects on enabled inactive controls.	
							clDisabledMid		Dark (but lighter than clDisabledDark) color in 3D effects on disabled controls.	
							clActiveMid		Dark (but darker than clActiveDark) color in 3D effects on active controls.	
							clDark			Base color for dark areas in 3-D effects	
							clNormalDark		Dark color in 3D effects on enabled inactive controls.	
							clDisabledDark		Dark color in 3D effects on disabled controls.	
							clActiveDark		Dark color in 3D effects on active controls.	
							clShadow		Base color for darkest areas in 3-D effects	
							clNormalShadow		Darkest color in 3D effects on enabled inactive controls.	
							clDisabledShadow	Darkest color in 3D effects on disabled controls.	
							clActiveShadow		Darkest color in 3D effects on active controls.	


TColorGroup is used to specify a group of colors that are used to paint objects in a specific state.

Unit

QGraphics

type TColorGroup = (cgInactive, cgDisabled, cgActive);

Description

Each palette generates a set of symbolic colors that reflect both a color group and a color role. TColorGroup is used to indicate the group of a symbolic color constant. It can have any of the following values:

Group             Meaning

cgInactive         Color is used on inactive controls.
cgDisabled         Color is used on disabled controls.
cgActive           Color is used on active controls.

TColorRole is used to specify the use of a color when painting a control.


Unit

QGraphics

type TColorRole = (crForeground, crButton, crLight, crMidlight, crDark, crMid, crText, crBrightText, crButtonText, crBase, crBackground, crShadow, crHighlight, crHighlightText, crNoRole);


Description

Each palette generates a set of symbolic colors that reflect both a color group and a color role. TColorRole is used to indicate the use of the color (what part of the control is being painted). The following table lists the possible values:

Role               Meaning

crForeground      Foreground color (for example, the color of lines or text). 
crButton            Background color for button controls.
crLight             Lightest areas in 3-D effects
crMidlight          Light (but darker than crLight) areas in 3-D effects
crDark             Dark areas in 3-D effects
crMid              Dark (but lighter than crDark) areas in 3-D effects
crText              Foreground color on text controls (color of the font). 
crBrightText        Bright contrasting text color.
crButtonText       Foreground color for the caption on buttons.
crBase             Background color for text controls.
crBackground      Background color (for example, the color of a window)
crShadow          Darkest areas in 3-D effects.
crHighlight         Background color for selected or highlighted items.
crHighlightText     Foreground color for selected or highlighted items.
crNoRole           Unspecified role




More information about the Lazarus mailing list