ccolor

Paul Gr pauls_postbus at hotmail.com
Tue Mar 8 11:46:55 UTC 2005


Hi Lena,

The following lines all set the background color to red:

TextDisplay1.BackColor = CColor("255, 0, 0")  ' format is "rrr, ggg, bbb"
TextDisplay1.BackColor = CColor("red")
TextDisplay1.BackColor = &H000000FF     ' format is &H00BBGGRR


To prevent typing or calculating hex-values, you could also add the
following function to the user section of the script:

Function RGBtoHEX(r as long, g as long, b as long) as long
   ' all values as longs to prevent overflows
   Debug.Assert r>=0 And r<256
   Debug.Assert g>=0 And g<256
   Debug.Assert b>=0 And b<256
   RGBtoHEX = (b * &H00010000) + (g * &H000100) + r
End Function

And then use this function to explicitly specify the red, green and blue
values:
TextDisplay1.BackColor = RGBtoHEX(255,0,0)

Paul Groot
Vrije Universiteit Amsterdam

>From: "Katz, Lena B." <katzlb at upmc.edu>
>To: <eprime at mail.talkbank.org>
>Subject: ccolor
>Date: Mon, 7 Mar 2005 13:36:04 -0500
>
>Dear List,
>
>Can ccolor take hex RGB values?  I.e. if I wanted burnt umber, could I
>simply enter the hex value?
>
>Lena

_________________________________________________________________
Spreek vrienden en familie met MSN Messenger http://messenger.msn.nl/



More information about the Eprime mailing list