Get the numeric value for a colorTag(s): Powerscript


(from the pfc_n_cst_color class)
BUTTONFACE =  78682240
WINDOW_BACKGROUND = 1087434968
WINDOW_TEXT = 33554592
APPLICATION_WORKSPACE = 268435456
TRANSPARENT = 553648127

BLACK = RGB(0, 0, 0)
WHITE = RGB(255, 255, 255)
LIGHT_GRAY = RGB(192, 192, 192)
DARK_GRAY = RGB(128, 128, 128)
RED = RGB(255, 0, 0)
DARK_RED = RGB(128, 0, 0)
GREEN = RGB(0, 255, 0)
DARK_GREEN = RGB(0, 128, 0)
BLUE = RGB(0, 0, 255)
DARK_BLUE = RGB(0, 0, 128)
MAGENTA = RGB(255, 0, 255)
DARK_MAGENTA = RGB(128, 0, 128)
CYAN = RGB(0, 255, 255)
DARK_CYAN = RGB(0, 128, 128)
YELLOW = RGB(255, 255, 0)
BROWN = RGB(128, 128, 0)
These values are hard-coded, if you need more flexibilty, you can query Windows to dynamically get the current color setting.
[External function declaration]
FUNCTION unsignedlong GetSysColor(int nIndex) LIBRARY "user32.dll"
using the following parameters :
COLOR_SCROLLBAR           0
COLOR_BACKGROUND          1
COLOR_ACTIVECAPTION       2
COLOR_INACTIVECAPTION     3
COLOR_MENU                4
COLOR_WINDOW              5
COLOR_WINDOWFRAME         6
COLOR_MENUTEXT            7
COLOR_WINDOWTEXT          8
COLOR_CAPTIONTEXT         9
COLOR_ACTIVEBORDER        10
COLOR_INACTIVEBORDER      11
COLOR_APPWORKSPACE        12
COLOR_HIGHLIGHT           13
CLOR_HIGHLIGHTTEXT        14
COLOR_BTNFACE             15
COLOR_BTNSHADOW           16
COLOR_GRAYTEXT            17
COLOR_BTNTEXT             18
COLOR_INACTIVECAPTIONTEXT 19
COLOR_BTNHIGHLIGHT        20

// (WINVER >= 0x0400)
COLOR_3DDKSHADOW          21
COLOR_3DLIGHT             22
COLOR_INFOTEXT            23
COLOR_INFOBK              24
COLOR_DESKTOP             COLOR_BACKGROUND
COLOR_3DFACE              COLOR_BTNFACE
COLOR_3DSHADOW            COLOR_BTNSHADOW
CLOR_3DHIGHLIGHT          COLOR_BTNHIGHLIGHT
COLOR_3DHILIGHT           COLOR_BTNHIGHLIGHT
COLOR_BTNHILIGHT          COLOR_BTNHIGHLIGHT

blog comments powered by Disqus