This article applies to:
E-Prime 3.0
E-Prime 2.0
This item was introduced in E-Prime 2.0 (2.0.1.1).
Detail
CColor provides access to the Color and RteColor objects, as well as the entire HTML color listing.
Color during Experiment Design
During experiment design and development, it is possible to assign HTML colors to individual objects and sub-objects, assuming that their assignable properties permit. For instance, it is possible to assign the ForeColor property of the TextDisplay object to 'MediumSlateBlue'.
Alternatively, it is possible to utilize the RGB values for each object within their assignable property. For example, it is possible to assign the BackColor property of the Slide object to '250,128,114' which is the RGB value for the 'Salmon' HTML color. Note the absence of the space between each value.
Color object at Runtime
At runtime, the Color object can be used to gain access to each color. The Color object is a RteCollection of RteColor objects. A color can be accessed by its integer index or text name. A RteColor object is returned from the collection. Its default value is the CColor value that can be assigned by an object's property. In addition, the color can be returned via a . property that represents the name of the color.
RteColor
The RteColor object at runtime has the following properties:
- .Color - Default property returns the CColor value used to assign to object properties
- .Text - The text name of the color
- .Red - The value of the red component of the color
- .Green - The value of the green component of the color
- .Blue - The value of the blue component of the color
Examples
'The following are all the same statement
Stimulus.BackColor = Color.AliceBlue
Stimulus.BackColor = Color(1)
Stimulus.BackColor = Color("AliceBlue")
Stimulus.BackColor = CColor(Color.AliceBlue.Red & "," & Color.AliceBlue.Green & "," & Color.AliceBlue.Blue)
The Colors
Color Name | RGB (Decimal) | RGB (Hex) |
AliceBlue | 240, 248, 255 | 0xF0, 0xF8, 0xFF |
AntiqueWhite | 250, 235, 215 | 0xFA, 0xEB, 0xD7 |
Aqua | 0, 255, 255 | 0x0, 0xFF, 0xFF |
Azure | 240, 255, 255 | 0xF0, 0xFF, 0xFF |
Beige | 245, 245, 220 | 0xF5, 0xF5, 0xDC |
Bisque | 255, 228, 196 | 0xFF, 0xE4, 0xC4 |
BlanchedAlmond | 255, 235, 205 | 0xFF, 0xEB, 0xCD |
Black | 0, 0, 0 | 0x0, 0x0, 0x0 |
Blue | 0, 0, 255 | 0x0, 0x0, 0xFF |
BlueViolet | 138, 43, 226 | 0x8A, 0x2B, 0xE2 |
Brown | 165, 42, 42 | 0xA5, 0x2A, 0x2A |
Burlywood | 222, 184, 135 | 0xDE, 0xB8, 0x87 |
CadetBlue | 95, 158, 160 | 0x5F, 0x9E, 0xA0 |
Chartreuse | 127, 255, 0 | 0x7F, 0xFF, 0x0 |
Chocolate | 210, 105, 30 | 0xD2, 0x69, 0x1E |
Coral | 255, 127, 80 | 0xFF, 0x7F, 0x50 |
CornflowerBlue | 100, 149, 237 | 0x64, 0x95, 0xED |
Cornsilk | 255, 248, 220 | 0xFF, 0xF8, 0xDC |
Crimson | 220, 20, 60 | 0xDC, 0x14, 0x3C |
Cyan | 0, 255, 255 | 0x0, 0xFF, 0xFF |
DarkBlue | 0, 0, 139 | 0x0, 0x0, 0x8B |
DarkCyan | 0, 139, 139 | 0x0, 0x8B, 0x8B |
DarkGoldenrod | 184, 134, 11 | 0xB8, 0x86, 0xB |
DarkGray | 169, 169, 169 | 0xA9, 0xA9, 0xA9 |
DarkGreen | 0, 100, 0 | 0x0, 0x64, 0x0 |
DarkKhaki | 189, 183, 107 | 0xBD, 0xB7, 0x6B |
DarkMagenta | 139, 0, 139 | 0x8B, 0x0, 0x8B |
DarkRed | 139, 0, 0 | 0x8B, 0x0, 0x0 |
DarkOliveGreen | 85, 107, 47 | 0x55, 0x6B, 0x2F |
DarkOrange | 255, 140, 0 | 0xFF, 0x8C, 0x0 |
DarkOrchid | 153, 50, 204 | 0x99, 0x32, 0xCC |
DarkSalmon | 233, 150, 122 | 0xE9, 0x96, 0x7A |
DarkSeaGreen | 143, 188, 139 | 0x8F, 0xBC, 0x8B |
DarkSlateBlue | 72, 61, 139 | 0x48, 0x3D, 0x8B |
DarkSlateGray | 47, 79, 79 | 0x2F, 0x4F, 0x4F |
DarkTurquoise | 0, 206, 209 | 0x0, 0xCE, 0xD1 |
DarkViolet | 148, 0, 211 | 0x94, 0x0, 0xD3 |
DeepPink | 255, 20, 147 | 0xFF, 0x14, 0x93 |
DeepSkyBlue | 0, 191, 255 | 0x0, 0xBF, 0xFF |
DimGray | 105, 105, 105 | 0x69, 0x69, 0x69 |
DodgerBlue | 30, 144, 255 | 0x1E, 0x90, 0xFF |
Firebrick | 178, 34, 34 | 0xB2, 0x22, 0x22 |
FloralWhite | 255, 250, 240 | 0xFF, 0xFA, 0xF0 |
ForestGreen | 34, 139, 34 | 0x22, 0x8B, 0x22 |
Fuchsia | 255, 0, 255 | 0xFF, 0x0, 0xFF |
Gainsboro | 220, 220, 220 | 0xDC, 0xDC, 0xDC |
GhostWhite | 248, 248, 255 | 0xF8, 0xF8, 0xFF |
Gold | 255, 215, 0 | 0xFF, 0xD7, 0x0 |
Goldenrod | 218, 165, 32 | 0xDA, 0xA5, 0x20 |
Gray | 128, 128, 128 | 0x80, 0x80, 0x80 |
Green | 0, 128, 0 | 0x0, 0x80, 0x0 |
GreenYellow | 173, 255, 47 | 0xAD, 0xFF, 0x2F |
Honeydew | 240, 255, 240 | 0xF0, 0xFF, 0xF0 |
HotPink | 255, 105, 180 | 0xFF, 0x69, 0xB4 |
IndianRed | 205, 92, 92 | 0xCD, 0x5C, 0x5C |
Indigo | 75, 0, 130 | 0x4B, 0x0, 0x82 |
Ivory | 255, 255, 240 | 0xFF, 0xFF, 0xF0 |
Khaki | 240, 230, 140 | 0xF0, 0xE6, 0x8C |
Lavender | 230, 230, 250 | 0xE6, 0xE6, 0xFA |
LavenderBlush | 255, 240, 245 | 0xFF, 0xF0, 0xF5 |
LawnGreen | 124, 252, 0 | 0x7C, 0xFC, 0x0 |
LemonChiffon | 255, 250, 205 | 0xFF, 0xFA, 0xCD |
LightBlue | 173, 216, 230 | 0xAD, 0xD8, 0xE6 |
LightCoral | 240, 128, 128 | 0xF0, 0x80, 0x80 |
LightCyan | 224, 255, 255 | 0xE0, 0xFF, 0xFF |
LightGoldenrodYellow | 250, 250, 210 | 0xFA, 0xFA, 0xD2 |
LightGreen | 144, 238, 144 | 0x90, 0xEE, 0x90 |
LightGrey | 211, 211, 211 | 0xD3, 0xD3, 0xD3 |
LightPink | 255, 182, 193 | 0xFF, 0xB6, 0xC1 |
LightSalmon | 255, 160, 122 | 0xFF, 0xA0, 0x7A |
LightSeaGreen | 32, 178, 170 | 0x20, 0xB2, 0xAA |
LightSkyBlue | 135, 206, 250 | 0x87, 0xCE, 0xFA |
LightSlateGray | 119, 136, 153 | 0x77, 0x88, 0x99 |
LightSteelBlue | 176, 196, 222 | 0xB0, 0xC4, 0xDE |
LightYellow | 255, 255, 224 | 0xFF, 0xFF, 0xE0 |
Lime | 0, 255, 0 | 0x0, 0xFF, 0x0 |
LimeGreen | 50, 205, 50 | 0x32, 0xCD, 0x32 |
Linen | 250, 240, 230 | 0xFA, 0xF0, 0xE6 |
Magenta | 255, 0, 255 | 0xFF, 0x0, 0xFF |
Maroon | 128, 0, 0 | 0x80, 0x0, 0x0 |
MediumAquamarine | 102, 205, 170 | 0x66, 0xCD, 0xAA |
MediumBlue | 0, 0, 205 | 0x0, 0x0, 0xCD |
MediumOrchid | 186, 85, 211 | 0xBA, 0x55, 0xD3 |
MediumPurple | 147, 112, 219 | 0x93, 0x70, 0xDB |
MediumSeaGreen | 60, 179, 113 | 0x3C, 0xB3, 0x71 |
MediumSlateBlue | 123, 104, 238 | 0x7B, 0x68, 0xEE |
MediumSpringGreen | 0, 250, 154 | 0x0, 0xFA, 0x9A |
MediumTurquoise | 72, 209, 204 | 0x48, 0xD1, 0xCC |
MediumVioletRed | 199, 21, 133 | 0xC7, 0x15, 0x85 |
MidnightBlue | 25, 25, 112 | 0x19, 0x19, 0x70 |
MintCream | 245, 255, 250 | 0xF5, 0xFF, 0xFA |
MistyRose | 255, 228, 225 | 0xFF, 0xE4, 0xE1 |
Moccasin | 255, 228, 181 | 0xFF, 0xE4, 0xB5 |
NavajoWhite | 255, 222, 173 | 0xFF, 0xDE, 0xAD |
Navy | 0, 0, 128 | 0x0, 0x0, 0x80 |
OldLace | 253, 245, 230 | 0xFD, 0xF5, 0xE6 |
Olive | 128, 128, 0 | 0x80, 0x80, 0x0 |
OliveDrab | 107, 142, 35 | 0x6B, 0x8E, 0x23 |
Orange | 255, 165, 0 | 0xFF, 0xA5, 0x0 |
OrangeRed | 255, 69, 0 | 0xFF, 0x45, 0x0 |
Orchid | 218, 112, 214 | 0xDA, 0x70, 0xD6 |
PaleGoldenrod | 238, 232, 170 | 0xEE, 0xE8, 0xAA |
PaleGreen | 152, 251, 152 | 0x98, 0xFB, 0x98 |
PaleTurquoise | 175, 238, 238 | 0xAF, 0xEE, 0xEE |
PaleVioletRed | 219, 112, 147 | 0xDB, 0x70, 0x93 |
PapayaWhip | 255, 239, 213 | 0xFF, 0xEF, 0xD5 |
PeachPuff | 255, 218, 185 | 0xFF, 0xDA, 0xB9 |
Peru | 205, 133, 63 | 0xCD, 0x85, 0x3F |
Pink | 255, 192, 203 | 0xFF, 0xC0, 0xCB |
Plum | 221, 160, 221 | 0xDD, 0xA0, 0xDD |
PowderBlue | 176, 224, 230 | 0xB0, 0xE0, 0xE6 |
Purple | 128, 0, 128 | 0x80, 0x0, 0x80 |
Red | 255, 0, 0 | 0xFF, 0x0, 0x0 |
RosyBrown | 188, 143, 143 | 0xBC, 0x8F, 0x8F |
RoyalBlue | 65, 105, 225 | 0x41, 0x69, 0xE1 |
SaddleBrown | 139, 69, 19 | 0x8B, 0x45, 0x13 |
Salmon | 250, 128, 114 | 0xFA, 0x80, 0x72 |
SandyBrown | 244, 164, 96 | 0xF4, 0xA4, 0x60 |
SeaGreen | 46, 139, 87 | 0x2E, 0x8B, 0x57 |
SeaShell | 255, 245, 238 | 0xFF, 0xF5, 0xEE |
Sienna | 160, 82, 45 | 0xA0, 0x52, 0x2D |
Silver | 192, 192, 192 | 0xC0, 0xC0, 0xC0 |
SkyBlue | 135, 206, 235 | 0x87, 0xCE, 0xEB |
SlateBlue | 106, 90, 205 | 0x6A, 0x5A, 0xCD |
SlateGray | 112, 128, 144 | 0x70, 0x80, 0x90 |
Snow | 255, 250, 250 | 0xFF, 0xFA, 0xFA |
SpringGreen | 0, 255, 127 | 0x0, 0xFF, 0x7F |
SteelBlue | 70, 130, 180 | 0x46, 0x82, 0xB4 |
Tan | 210, 180, 140 | 0xD2, 0xB4, 0x8C |
Teal | 0, 128, 128 | 0x0, 0x80, 0x80 |
Thistle | 216, 191, 216 | 0xD8, 0xBF, 0xD8 |
Tomato | 255, 99, 71 | 0xFF, 0x63, 0x47 |
Turquoise | 64, 224, 208 | 0x40, 0xE0, 0xD0 |
Violet | 238, 130, 238 | 0xEE, 0x82, 0xEE |
Wheat | 245, 222, 179 | 0xF5, 0xDE, 0xB3 |
White | 255, 255, 255 | 0xFF, 0xFF, 0xFF |
WhiteSmoke | 245, 245, 245 | 0xF5, 0xF5, 0xF5 |
Yellow | 255, 255, 0 | 0xFF, 0xFF, 0x0 |
YellowGreen | 154, 205, 50 | 0x9A, 0xCD, 0x32 |
The following E-Basic was used to create the table above:
Dim strTextColor As String
Dim str As String
'Begin table
str = str & "<table>" & ebCrLf
'Heading
str = str & "<tr><th>Color Name</th><th>RGB (Decimal)</th><th>RGB (Hex)</th></tr>" & ebCrLf
Dim nColor As Long
For nColor = 1 To Color.Count
'Determine how many components are dark
Dim nNumDark As Long
nNumDark = 0
If Color(nColor).Red < 128 Then nNumDark = nNumDark + 1
If Color(nColor).Green < 128 Then nNumDark = nNumDark + 1
If Color(nColor).Blue < 128 Then nNumDark = nNumDark + 1
'Deterimine text color
If nNumDark > 1 Then
strTextColor = "white"
Else
strTextColor = "black"
End If
'New Row
str = str & "<tr bgcolor='" & Color(nColor).Text & "'>" & ebCrLf
'Text
str = str & "<td><span style='color: " & strTextColor & "';>" & Color(nColor).Text & "</span></td>" & ebCrLf
'RGB (Decimal)
str = str & "<td><span style='color: " & strTextColor & "';>" & Color(nColor).Red & ", " & Color(nColor).Green & ", " & Color(nColor).Blue & "</td>" & ebCrLf
'RGB (Hex)
str = str & "<td><span style='color: " & strTextColor & "';>0x" & Hex(Color(nColor).Red) & ", 0x" & Hex(Color(nColor).Green) & ", 0x" & Hex(Color(nColor).Blue) & "</td>" & ebCrLf
'End Of Row
str = str & "</tr>" & ebCrLf
Next
'End table
str = str & "<table>" & ebCrLf
'Open the file
Dim nFile As Long
nFile = FreeFile
Open "color.html" For Output As #nFile
'Write the html
Print #nFile, str
'Close
Close nFile
For further information on scripting using E-Basic, please refer to the E-Prime Command Reference (https://pstnet.com/ecr).
Comments
0 comments
Please sign in to leave a comment.