Get Long Color In PowerBuilder
1 | Function Long GetSysColor ( Long nIndex ) Library "user32.dll" |
PowerScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | // ----------------------------------------------------------------------------- // SCRIPT: f_Color // // PURPOSE: This function returns a color code for a named color. It includes // all the PowerBuilder, System, and Web colors. // // ARGUMENTS: as_colorname - Name of the color // // RETURN: Color code // ----------------------------------------------------------------------------- Long ll_color Choose Case Upper(as_colorname) // PowerBuilder Colors (not defined elsewhere) Case "MINT" ll_color = RGB(192, 220, 192) Case "SKY" ll_color = RGB(166, 202, 240) Case "CREAM" ll_color = RGB(255, 251, 240) Case "MEDIUM GRAY" ll_color = RGB(160, 160, 164) // System Colors Case "COLOR_SCROLLBAR", "SCROLL BAR" // Scroll bar gray area. ll_color = GetSysColor(0) Case "COLOR_DESKTOP", "DESKTOP" // Desktop. ll_color = GetSysColor(1) Case "COLOR_ACTIVECAPTION", "ACTIVE TITLE BAR" // Active window title bar. ll_color = GetSysColor(2) Case "COLOR_INACTIVECAPTION", "INACTIVE TITLE BAR" // Inactive window caption. ll_color = GetSysColor(3) Case "COLOR_MENU", "MENU BAR" // Menu background. ll_color = GetSysColor(4) Case "COLOR_WINDOW", "WINDOW BACKGROUND" // Window background. ll_color = GetSysColor(5) Case "COLOR_WINDOWFRAME", "WINDOW FRAME" // Window frame. ll_color = GetSysColor(6) Case "COLOR_MENUTEXT", "MENU TEXT" // Text in menus. ll_color = GetSysColor(7) Case "COLOR_WINDOWTEXT", "WINDOW TEXT" // Text in windows. ll_color = GetSysColor(8) Case "COLOR_CAPTIONTEXT", "ACTIVE TITLE BAR TEXT" // Text in caption, size box, and scroll bar arrow box. ll_color = GetSysColor(9) Case "COLOR_ACTIVEBORDER", "ACTIVE BORDER" // Active window border. ll_color = GetSysColor(10) Case "COLOR_INACTIVEBORDER", "INACTIVE BORDER" // Inactive window border. ll_color = GetSysColor(11) Case "COLOR_APPWORKSPACE", "APPLICATION WORKSPACE" // Background color of multiple document interface (MDI) applications. ll_color = GetSysColor(12) Case "COLOR_HIGHLIGHT", "HIGHLIGHT" // Item(s) selected in a control. ll_color = GetSysColor(13) Case "COLOR_HIGHLIGHTTEXT", "HIGHLIGHT TEXT" // Text of item(s) selected in a control. ll_color = GetSysColor(14) Case "COLOR_BTNFACE", "COLOR_3DFACE", "BUTTON FACE" // Face color for three-dimensional display elements and for dialog box backgrounds. ll_color = GetSysColor(15) Case "COLOR_BTNSHADOW", "COLOR_3DSHADOW", "BUTTON SHADOW" // Shadow color for three-dimensional display elements (for edges facing away from the light source). ll_color = GetSysColor(16) Case "COLOR_GRAYTEXT", "DISABLE TEXT" // Grayed (disabled) text. ll_color = GetSysColor(17) Case "COLOR_BTNTEXT", "BUTTON TEXT" // Text on push buttons. ll_color = GetSysColor(18) Case "COLOR_INACTIVECAPTIONTEXT", "INACTIVE TITLE BAR TEXT" // Color of text in an inactive caption. ll_color = GetSysColor(19) Case "COLOR_3DHIGHLIGHT", "BUTTON HIGHLIGHT" // Highlight color for three-dimensional display elements (for edges facing the light source.) ll_color = GetSysColor(20) Case "COLOR_3DDKSHADOW", "BUTTON DARK SHADOW" // Dark shadow for three-dimensional display elements. ll_color = GetSysColor(21) Case "COLOR_3DLIGHT", "BUTTON LIGHT SHADOW" // Light color for three-dimensional display elements (for edges facing the light source.) ll_color = GetSysColor(22) Case "COLOR_INFOTEXT", "TOOLTIP TEXT" // Text color for tooltip controls. ll_color = GetSysColor(23) Case "COLOR_INFOBK", "TOOLTIP" // Background color for tooltip controls. ll_color = GetSysColor(24) Case "COLOR_HOTLIGHT", "LINK" // Color for a hyperlink or hot-tracked item. ll_color = GetSysColor(26) Case "COLOR_GRADIENTACTIVECAPTION" // Right side color in the color gradient of an active window's title bar. ll_color = GetSysColor(27) Case "COLOR_GRADIENTINACTIVECAPTION" // Right side color in the color gradient of an inactive window's title bar. ll_color = GetSysColor(28) Case "COLOR_MENUHILIGHT" // The color used to highlight menu items when the menu appears as a flat menu (see SystemParametersInfo). ll_color = GetSysColor(29) Case "COLOR_MENUBAR" // The background color for the menu bar when menus appear as flat menus (see SystemParametersInfo). ll_color = GetSysColor(30) // Web Color Pinks Case "PINK" ll_color = RGB(255,192,203) Case "LIGHTPINK" ll_color = RGB(255,182,193) Case "HOTPINK" ll_color = RGB(255,105,180) Case "DEEPPINK" ll_color = RGB(255,20,147) Case "PALEVIOLETRED" ll_color = RGB(219,112,147) Case "MEDIUMVIOLETRED" ll_color = RGB(199,21,13) // Web Colors Red Case "LIGHTSALMON" ll_color = RGB(255,160,122) Case "SALMON" ll_color = RGB(250,128,114) Case "DARKSALMON" ll_color = RGB(233,150,122) Case "LIGHTCORAL" ll_color = RGB(240,128,128) Case "INDIANRED" ll_color = RGB(205,92,92) Case "CRIMSON" ll_color = RGB(220,20,60) Case "FIREBRICK" ll_color = RGB(178,34,34) Case "DARKRED" ll_color = RGB(139,0,0) Case "RED" ll_color = RGB(255,0,0) // Web Color Oranges Case "ORANGERED" ll_color = RGB(255,69,0) Case "TOMATO" ll_color = RGB(255,99,71) Case "CORAL" ll_color = RGB(255,127,80) Case "DARKORANGE" ll_color = RGB(255,140,0) Case "ORANGE" ll_color = RGB(255,165,0) // Web Color Yellows Case "YELLOW" ll_color = RGB(255,255,0) Case "LIGHTYELLOW" ll_color = RGB(255,255,224) Case "LEMONCHIFFON" ll_color = RGB(255,250,205) Case "LIGHTGOLDENRODYELLOW" ll_color = RGB(250,250,210) Case "PAPAYAWHIP" ll_color = RGB(255,239,213) Case "MOCCASIN" ll_color = RGB(255,228,181) Case "PEACHPUFF" ll_color = RGB(255,218,185) Case "PALEGOLDENROD" ll_color = RGB(238,232,170) Case "KHAKI" ll_color = RGB(240,230,140) Case "DARKKHAKI" ll_color = RGB(189,183,107) Case "GOLD" ll_color = RGB(255,215,0) // Web Color Browns Case "CORNSILK" ll_color = RGB(255,248,220) Case "BLANCHEDALMOND" ll_color = RGB(255,235,205) Case "BISQUE" ll_color = RGB(255,228,196) Case "NAVAJOWHITE" ll_color = RGB(255,222,173) Case "WHEAT" ll_color = RGB(245,222,179) Case "BURLYWOOD" ll_color = RGB(222,184,135) Case "TAN" ll_color = RGB(210,180,140) Case "ROSYBROWN" ll_color = RGB(188,143,143) Case "SANDYBROWN" ll_color = RGB(244,164,96) Case "GOLDENROD" ll_color = RGB(218,165,32) Case "DARKGOLDENROD" ll_color = RGB(184,134,11) Case "PERU" ll_color = RGB(205,133,63) Case "CHOCOLATE" ll_color = RGB(210,105,30) Case "SADDLEBROWN" ll_color = RGB(139,69,19) Case "SIENNA" ll_color = RGB(160,82,45) Case "BROWN" ll_color = RGB(165,42,42) Case "MAROON" ll_color = RGB(128,0,0) // Web Color Greens Case "DARKOLIVEGREEN" ll_color = RGB(85,107,47) Case "OLIVE" ll_color = RGB(128,128,0) Case "OLIVEDRAB" ll_color = RGB(107,142,35) Case "YELLOWGREEN" ll_color = RGB(154,205,50) Case "LIMEGREEN" ll_color = RGB(50,205,50) Case "LIME" ll_color = RGB(0,255,0) Case "LAWNGREEN" ll_color = RGB(124,252,0) Case "CHARTREUSE" ll_color = RGB(127,255,0) Case "GREENYELLOW" ll_color = RGB(173,255,47) Case "SPRINGGREEN" ll_color = RGB(0,255,127) Case "MEDIUMSPRINGGREEN" ll_color = RGB(0,250,154) Case "LIGHTGREEN" ll_color = RGB(144,238,144) Case "PALEGREEN" ll_color = RGB(152,251,152) Case "DARKSEAGREEN" ll_color = RGB(143,188,143) Case "MEDIUMSEAGREEN" ll_color = RGB(60,179,113) Case "SEAGREEN" ll_color = RGB(46,139,87) Case "FORESTGREEN" ll_color = RGB(34,139,34) Case "GREEN" ll_color = RGB(0,128,0) Case "DARKGREEN" ll_color = RGB(0,100,0) // Web Color Cyans Case "MEDIUMAQUAMARINE" ll_color = RGB(102,205,170) Case "AQUA" ll_color = RGB(0,255,255) Case "CYAN" ll_color = RGB(0,255,255) Case "LIGHTCYAN" ll_color = RGB(224,255,255) Case "PALETURQUOISE" ll_color = RGB(175,238,238) Case "AQUAMARINE" ll_color = RGB(127,255,212) Case "TURQUOISE" ll_color = RGB(64,224,208) Case "MEDIUMTURQUOISE" ll_color = RGB(72,209,204) Case "DARKTURQUOISE" ll_color = RGB(0,206,209) Case "LIGHTSEAGREEN" ll_color = RGB(32,178,170) Case "CADETBLUE" ll_color = RGB(95,158,160) Case "DARKCYAN" ll_color = RGB(0,139,139) Case "TEAL" ll_color = RGB(0,128,128) // Web Color Blues Case "LIGHTSTEELBLUE" ll_color = RGB(176,196,222) Case "POWDERBLUE" ll_color = RGB(176,224,230) Case "LIGHTBLUE" ll_color = RGB(173,216,230) Case "SKYBLUE" ll_color = RGB(135,206,235) Case "LIGHTSKYBLUE" ll_color = RGB(135,206,250) Case "DEEPSKYBLUE" ll_color = RGB(0,191,255) Case "DODGERBLUE" ll_color = RGB(30,144,255) Case "CORNFLOWERBLUE" ll_color = RGB(100,149,237) Case "STEELBLUE" ll_color = RGB(70,130,180) Case "ROYALBLUE" ll_color = RGB(65,105,225) Case "BLUE" ll_color = RGB(0,0,255) Case "MEDIUMBLUE" ll_color = RGB(0,0,205) Case "DARKBLUE" ll_color = RGB(0,0,139) Case "NAVY" ll_color = RGB(0,0,128) Case "MIDNIGHTBLUE" ll_color = RGB(25,25,112) // Web Color Purples Case "LAVENDER" ll_color = RGB(230,230,250) Case "THISTLE" ll_color = RGB(216,191,216) Case "PLUM" ll_color = RGB(221,160,221) Case "VIOLET" ll_color = RGB(238,130,238) Case "ORCHID" ll_color = RGB(218,112,214) Case "FUCHSIA" ll_color = RGB(255,0,255) Case "MAGENTA" ll_color = RGB(255,0,255) Case "MEDIUMORCHID" ll_color = RGB(186,85,211) Case "MEDIUMPURPLE" ll_color = RGB(147,112,219) Case "BLUEVIOLET" ll_color = RGB(138,43,226) Case "DARKVIOLET" ll_color = RGB(148,0,211) Case "DARKORCHID" ll_color = RGB(153,50,204) Case "DARKMAGENTA" ll_color = RGB(139,0,139) Case "PURPLE" ll_color = RGB(128,0,128) Case "INDIGO" ll_color = RGB(75,0,130) Case "DARKSLATEBLUE" ll_color = RGB(72,61,139) Case "SLATEBLUE" ll_color = RGB(106,90,205) Case "MEDIUMSLATEBLUE" ll_color = RGB(123,104,238) // Web Color Whites Case "WHITE" ll_color = RGB(255,255,255) Case "SNOW" ll_color = RGB(255,250,250) Case "HONEYDEW" ll_color = RGB(240,255,240) Case "MINTCREAM" ll_color = RGB(245,255,250) Case "AZURE" ll_color = RGB(240,255,255) Case "ALICEBLUE" ll_color = RGB(240,248,255) Case "GHOSTWHITE" ll_color = RGB(248,248,255) Case "WHITESMOKE" ll_color = RGB(245,245,245) Case "SEASHELL" ll_color = RGB(255,245,238) Case "BEIGE" ll_color = RGB(245,245,220) Case "OLDLACE" ll_color = RGB(253,245,230) Case "FLORALWHITE" ll_color = RGB(255,250,240) Case "IVORY" ll_color = RGB(255,255,240) Case "ANTIQUEWHITE" ll_color = RGB(250,235,215) Case "LINEN" ll_color = RGB(250,240,230) Case "LAVENDERBLUSH" ll_color = RGB(255,240,245) Case "MISTYROSE" ll_color = RGB(255,228,225) // Web Color Grays/blacks Case "GAINSBORO" ll_color = RGB(220,220,220) Case "LIGHTGRAY" ll_color = RGB(211,211,211) Case "SILVER" ll_color = RGB(192,192,192) Case "DARKGRAY" ll_color = RGB(169,169,169) Case "GRAY" ll_color = RGB(128,128,128) Case "DIMGRAY" ll_color = RGB(105,105,105) Case "LIGHTSLATEGRAY" ll_color = RGB(119,136,153) Case "SLATEGRAY" ll_color = RGB(112,128,144) Case "DARKSLATEGRAY" ll_color = RGB(47,79,79) Case "BLACK" ll_color = RGB(0,0,0) // Default To White Case Else ll_color = RGB(255, 255, 255) End Choose Return ll_color |
Good Luck!