<< Click to Display Table of Contents >> Navigation: 2. Components > 3. System-Variable and Specialfolders > 3.4 System-Colors |
MiniRobotLanguage (MRL)
System-Colors
Intention
Normal colors values may differ on different target systems. This is because of changes in themes and graphics drivers and hardware.
To be able to use color values, you can use the "Windows System Colors" in many commands where Colors can be used.
System Colors are displayed in the Windows-Inspector, for the point which is currently below the mouse-cursor.
System-Colors may have the same values as other System-Colors on different systems. This is however a question of the design/theme that is used.
However, it is a fact that text is often black, as well as shadows.
You can use the CCV.-command to directly get the values of any System-Color.
Here is an example:
' Show value od System color S2
CCV.H|S2|$$HEX
DBP.$$HEX
ENR.
Systemcolor Definition (Color Type)
S0 - SCROLLBAR COLOR
S1 - BACKGROUND/DESKTOP COLOR
S2 - ACTIVE-CAPTION COLOR
S3 - INACTIVE-CAPTION COLOR
S4 - MENU COLOR, MSGBOX COLOR
S5 - WINDOW COLOR
S6 - WINDOW-FRAME COLOR
S7 - MENU-TEXT COLOR, MSGBOXTEXT COLOR
S8 - WINDOW-TEXT COLOR
S9 - CAPTION-TEXT COLOR
S10 - ACTIVEBORDER COLOR
S11 - INACTIVEBORDER COLOR
S12 - APPWORKSPACE COLOR
S13 - HIGHLIGHT COLOR
S14 - HIGHLIGHT-TEXT COLOR
S15 - BUTTON-FACE COLOR
S16 - BUTTON-SHADOW/3DSHADOW COLOR
S17 - GRAY-TEXT COLOR
S18 - BUTTON-TEXT COLOR
S19 - INACTIVE-CAPTION-TEXT COLOR
S20 - BUTTON-HIGHLIGHT COLOR
The following colors will not be available below Windows NT 4:
S21 - 3DDKSHADOW COLOR
S22 - 3DLIGHT COLOR
S23 - INFO-TEXT COLOR
S24 - INFO-BACKGROUND COLOR
S25 - not defined (&HB5B5B5 on XP here)
The following colors will not be available below Windows 2000:
S26 - HOTLIGHT COLOR
S27 - GRADIENT-ACTIVE-CAPTION COLOR
S28 - GRADIENT-INACTIVE-CAPTION COLOR
S29 - MENU-HILIGHT COLOR
S30 - MENUBAR
Example
'****************************
' Example 1
'****************************
' Brute Force Algo to guess undefined Systemcolor "S25"
' Needs quite a while to run, even as EXE.
'
$$COA=S25
$$COM=&HFFFFFF
FOR.$$COB|&HFFFFFF|0|-1
CCD.$$COA|$$COB|$$COD
IVV.$$COM>$$COD
$$COM=$$COD
$$COS=$$COB
PRT.Color: $$COS -> Difference: $$COM
EIF.
JIZ.$$COD|out
NEX.
:out
MBX.Color: $$COS -> Difference: $$COM
ENR.
Here is the output of the program on WinXP:
Remarks
When specifying Colors as hexadecimal values, prefer using this format:
&H0FFFFFF.
RRGGBB
If you omit the "&H0" or just use the "&H" this may lead to strange results when the values is converted to decimal. The reason for this is::
&HFFFF is -1 (conversion to signed number using "&H")
while
&H0FFFF is 65535 (conversion to unsigned number using "&H0")
as expected.
Limitations:
-
See also:
• CCD. - Calculate Color Distance
See further:
•3.5 Hexadezimal, Decimal and Binary and more
•3.6 Using Quadrant-Coordinates