Discussion:
Color names in color picker used in font common dialog
(too old to reply)
-mhd
2012-10-08 17:12:32 UTC
Permalink
I'm now rolling my own font dialog and want to match the list of 16 colors used
by the color dropbox in the MS font common dialog.

The color names in the MS version do not match the 16 QBCcolors so where can I
get the long rgb values of these colors? I sure would like to find a reference
(I Googled) but I am coming up short.

-mike
Jeff Johnson
2012-10-08 18:07:39 UTC
Permalink
Post by -mhd
I'm now rolling my own font dialog and want to match the list of 16 colors used
by the color dropbox in the MS font common dialog.
The color names in the MS version do not match the 16 QBCcolors so where can I
get the long rgb values of these colors? I sure would like to find a reference
(I Googled) but I am coming up short.
Try http://www.blacksunsoftware.com/screenmagnifier.html

It'll tell you the color value of the pixel under the cursor.
-mhd
2012-10-08 20:47:13 UTC
Permalink
Post by Jeff Johnson
Post by -mhd
I'm now rolling my own font dialog and want to match the list of 16 colors used
by the color dropbox in the MS font common dialog.
The color names in the MS version do not match the 16 QBCcolors so where can I
get the long rgb values of these colors? I sure would like to find a reference
(I Googled) but I am coming up short.
Try http://www.blacksunsoftware.com/screenmagnifier.html
It'll tell you the color value of the pixel under the cursor.
I don't think any of those utilities (I have a few) give the long rgb value but
rather the RGB separate values. I suppose I could drum up a quick app that has
the common font dialog control and debug print the returned color values.

Part of my question is however what collection are these 16 colors from? Not the
QBColors...

-mike
Mayayana
2012-10-08 21:20:13 UTC
Permalink
| Part of my question is however what collection are
| these 16 colors from? Not the QBColors...

Do you mean the colors that you get when choosing a
font in Wordpad? Olive, teal, etc.? Those do seem to be
QBColors, just with different names. Here's a printout of
the QBColors as long and as HTML hex (RGB).

0
8388608
32768
8421376
128
8388736
32896
12632256
8421504
16711680
65280
16776960
255
16711935
65535
16777215

000000
000080
008000
008080
800000
800080
808000
C0C0C0
808080
0000FF
00FF00
00FFFF
FF0000
FF00FF
FFFF00
FFFFFF

When I opened the font dialogue, did a screen capture,
and opened it in Paint Shop Pro, I find the font colors are
the same. They're nearly all combinations of 0 and 128 or
0 and 255 RGB. (0 0 128, 0 128 0, etc.)
-mhd
2012-10-08 23:29:16 UTC
Permalink
Post by Mayayana
Do you mean the colors that you get when choosing a
font in Wordpad? Olive, teal, etc.? Those do seem to be
QBColors, just with different names. Here's a printout of
the QBColors as long and as HTML hex (RGB).
Well that is great news as I can just dump the 16 QBColor values into the
ItemData field of a combobox and the use the same descriptions as Wordpad and
the font common dialog uses in the comboBox text.

-mike
-mhd
2012-10-09 00:14:22 UTC
Permalink
Post by Mayayana
Do you mean the colors that you get when choosing a
font in Wordpad? Olive, teal, etc.? Those do seem to be
QBColors, just with different names. Here's a printout of
the QBColors as long and as HTML hex (RGB).
I mapped your list to the named colors commonly used in Windows font choosers in
case anyone want to drop these in a control for their own color picker. I
reordered them to match the order Windows usually displays to maintain the look
and feel.

0 Black
800000 Maroon
8000 Green
808000 Olive
80 Navy
800080 Purple
8080 Teal
808080 Gray
C0C0C0 Silver
FF0000 Red
00FF00 Lime
FFFF00 Yellow
0000FF Blue
FF00FF Fuschia
00FFFF Aqua
FFFFFF White

0 Black
128 Maroon
32768 Green
32896 Olive
8388608 Navy
8388736 Purple
8421376 Teal
8421504 Gray
12632256 Silver
255 Red
65280 Lime
65535 Yellow
16711680 Blue
16711935 Fuschia
16776960 Aqua
16777215 White

-mike
Schmidt
2012-10-09 04:21:59 UTC
Permalink
Am 09.10.2012 02:14, schrieb -mhd:

Just another extended List (not over long) of Name-Color-pairs...
(this one conforms to the ColorNames, defined in the SVG-Standard)


'***Into a Form
Option Explicit

Private SVGColorMap As New cSVGColorMap, WithEvents lstColors As ListBox

Private Sub Form_Load()

Set lstColors = Controls.Add("VB.ListBox", "lstColors")
lstColors.Move 0, 0, ScaleWidth * 0.3, ScaleHeight
lstColors.Visible = True

Dim i As Long
For i = 0 To SVGColorMap.Count - 1
lstColors.AddItem SVGColorMap.NameByIndex(i)
Next i
End Sub

Private Sub lstColors_Click()
Me.BackColor = SVGColorMap.ColorByName(lstColors.Text)

'just for control-purposes (to test the NameByIndex-Property)
Me.Caption = SVGColorMap.NameByIndex(lstColors.ListIndex)
If Me.Caption <> lstColors.Text Then Stop
End Sub

'------------------------------------------------------------

'*** Into a Class cSVGColorMap
Option Explicit

Private mColorNames As Collection, mColorValues As Collection

Private Sub Class_Initialize()
Set mColorNames = New Collection
Set mColorValues = New Collection
InitSVGColorMap
End Sub

Public Sub Add(ColorName As String, ByVal ColorValue As Long)
mColorNames.Add ColorName, CStr(mColorNames.Count)
mColorValues.Add ColorValue, ColorName
End Sub

Public Property Get Count() As Long
Count = mColorValues.Count
End Property

Public Property Get ColorByName&(ColorName As String)
ColorByName = mColorValues(ColorName)
End Property

Public Property Get NameByIndex$(ByVal ColorIdxZerobased As Long)
NameByIndex = mColorNames(CStr(ColorIdxZerobased))
End Property

Public Property Get ColorByIndex&(ByVal ColorIdxZerobased As Long)
ColorByIndex = mColorValues(ColorNameByIndex(ColorIdxZerobased))
End Property

Private Sub InitSVGColorMap()
Add "AliceBlue", RGB(239, 247, 255)
Add "AntiqueWhite", RGB(249, 234, 215)
Add "Aqua", RGB(0, 255, 255)
Add "Aquamarine", RGB(126, 255, 211)
Add "Azure", RGB(239, 255, 255)
Add "Beige", RGB(244, 244, 220)
Add "Bisque", RGB(255, 227, 196)
Add "Black", RGB(0, 0, 0)
Add "BlanchedAlmond", RGB(255, 234, 205)
Add "Blue", RGB(0, 0, 255)
Add "BlueViolet", RGB(137, 43, 226)
Add "Brown", RGB(165, 42, 42)
Add "BurlyWood", RGB(221, 183, 135)
Add "CadetBlue", RGB(94, 158, 160)
Add "Chartreuse", RGB(126, 255, 0)
Add "Chocolate", RGB(210, 104, 29)
Add "Coral", RGB(255, 126, 79)
Add "CornflowerBlue", RGB(99, 149, 237)
Add "Cornsilk", RGB(255, 247, 220)
Add "Crimson", RGB(220, 20, 59)
Add "Cyan", RGB(0, 255, 255)
Add "DarkBlue", RGB(0, 0, 138)
Add "DarkCyan", RGB(0, 138, 138)
Add "DarkGoldenrod", RGB(183, 133, 11)
Add "DarkGray", RGB(169, 169, 169)
Add "DarkGreen", RGB(0, 99, 0)
Add "DarkGrey", RGB(169, 169, 169)
Add "DarkKhaki", RGB(188, 182, 107)
Add "DarkMagenta", RGB(138, 0, 138)
Add "DarkOliveGreen", RGB(84, 107, 47)
Add "DarkOrange", RGB(255, 140, 0)
Add "DarkOrchid", RGB(183, 49, 204)
Add "DarkRed", RGB(138, 0, 0)
Add "DarkSalmon", RGB(232, 150, 122)
Add "DarkSeaGreen", RGB(142, 187, 142)
Add "DarkSlateBlue", RGB(72, 61, 138)
Add "DarkSlateGray", RGB(47, 79, 79)
Add "DarkSlateGrey", RGB(47, 79, 79)
Add "DarkTurquoise", RGB(0, 206, 209)
Add "DarkViolet", RGB(147, 0, 211)
Add "DeepPink", RGB(255, 20, 146)
Add "DeepSkyBlue", RGB(0, 191, 255)
Add "DimGray", RGB(104, 104, 104)
Add "DimGrey", RGB(104, 104, 104)
Add "DodgerBlue", RGB(29, 144, 255)
Add "FireBrick", RGB(177, 33, 33)
Add "FloralWhite", RGB(255, 249, 239)
Add "ForestGreen", RGB(33, 138, 33)
Add "Fuchsia", RGB(255, 0, 255)
Add "Gainsboro", RGB(220, 220, 220)
Add "GhostWhite", RGB(247, 247, 255)
Add "Gold", RGB(255, 215, 0)
Add "Goldenrod", RGB(218, 165, 31)
Add "Gray", RGB(127, 127, 127)
Add "Green", RGB(0, 127, 0)
Add "GreenYellow", RGB(173, 255, 47)
Add "Grey", RGB(127, 127, 127)
Add "Honeydew", RGB(239, 255, 239)
Add "HotPink", RGB(255, 104, 179)
Add "IndianRed", RGB(205, 91, 91)
Add "Indigo", RGB(74, 0, 130)
Add "Ivory", RGB(255, 255, 239)
Add "Khaki", RGB(239, 229, 140)
Add "Lavender", RGB(229, 229, 249)
Add "LavenderBlush", RGB(255, 239, 244)
Add "LawnGreen", RGB(124, 252, 0)
Add "LemonChiffon", RGB(255, 249, 205)
Add "LightBlue", RGB(173, 216, 229)
Add "LightCoral", RGB(239, 127, 127)
Add "LightCyan", RGB(224, 255, 255)
Add "LightGoldenrod", RGB(237, 221, 130)
Add "LightGoldenrodYellow", RGB(249, 249, 210)
Add "LightGray", RGB(211, 211, 211)
Add "LightGreen", RGB(144, 237, 144)
Add "LightGrey", RGB(211, 211, 211)
Add "LightPink", RGB(255, 181, 192)
Add "LightSalmon", RGB(255, 160, 122)
Add "LightSeaGreen", RGB(31, 177, 170)
Add "LightSkyBlue", RGB(135, 206, 249)
Add "LightSlateBlue", RGB(132, 112, 255)
Add "LightSlateGray", RGB(119, 135, 153)
Add "LightSlateGrey", RGB(119, 135, 153)
Add "LightSteelBlue", RGB(175, 196, 221)
Add "LightYellow", RGB(255, 255, 224)
Add "Lime", RGB(0, 255, 0)
Add "LimeGreen", RGB(49, 205, 49)
Add "Linen", RGB(249, 239, 229)
Add "Magenta", RGB(255, 0, 255)
Add "Maroon", RGB(127, 0, 0)
Add "MediumAquamarine", RGB(102, 205, 170)
Add "MediumBlue", RGB(0, 0, 205)
Add "MediumOrchid", RGB(186, 84, 211)
Add "MediumPurple", RGB(146, 112, 219)
Add "MediumSeaGreen", RGB(59, 178, 113)
Add "MediumSlateBlue", RGB(123, 104, 237)
Add "MediumSpringGreen", RGB(0, 249, 154)
Add "MediumTurquoise", RGB(72, 209, 204)
Add "MediumVioletRed", RGB(198, 21, 132)
Add "MidnightBlue", RGB(24, 24, 112)
Add "MintCream", RGB(244, 255, 249)
Add "MistyRose", RGB(255, 227, 225)
Add "Moccasin", RGB(255, 227, 181)
Add "NavajoWhite", RGB(255, 221, 173)
Add "Navy", RGB(0, 0, 127)
Add "NavyBlue", RGB(0, 0, 127)
Add "OldLace", RGB(252, 244, 229)
Add "Olive", RGB(127, 127, 0)
Add "OliveDrab", RGB(107, 141, 34)
Add "Orange", RGB(255, 165, 0)
Add "OrangeRed", RGB(255, 68, 0)
Add "Orchid", RGB(218, 112, 214)
Add "PaleGoldenrod", RGB(237, 232, 170)
Add "PaleGreen", RGB(151, 251, 151)
Add "PaleTurquoise", RGB(175, 237, 237)
Add "PaleVioletRed", RGB(219, 112, 146)
Add "PapayaWhip", RGB(255, 238, 212)
Add "PeachPuff", RGB(255, 218, 184)
Add "Peru", RGB(205, 132, 63)
Add "Pink", RGB(255, 191, 202)
Add "Plum", RGB(221, 160, 221)
Add "PowderBlue", RGB(175, 224, 229)
Add "Purple", RGB(127, 0, 127)
Add "Red", RGB(255, 0, 0)
Add "RosyBrown", RGB(187, 142, 142)
Add "RoyalBlue", RGB(65, 104, 225)
Add "SaddleBrown", RGB(138, 68, 19)
Add "Salmon", RGB(249, 127, 114)
Add "SandyBrown", RGB(243, 164, 95)
Add "SeaGreen", RGB(45, 138, 86)
Add "Seashell", RGB(255, 244, 237)
Add "Sienna", RGB(160, 81, 44)
Add "Silver", RGB(191, 191, 191)
Add "SkyBlue", RGB(135, 206, 234)
Add "SlateBlue", RGB(105, 89, 205)
Add "SlateGray", RGB(112, 127, 144)
Add "SlateGrey", RGB(112, 127, 144)
Add "Snow", RGB(255, 249, 249)
Add "SpringGreen", RGB(0, 255, 126)
Add "SteelBlue", RGB(70, 130, 179)
Add "Tan", RGB(210, 179, 140)
Add "Teal", RGB(0, 127, 127)
Add "Thistle", RGB(216, 191, 216)
Add "Tomato", RGB(255, 99, 71)
Add "Turquoise", RGB(63, 224, 207)
Add "Violet", RGB(237, 130, 237)
Add "VioletRed", RGB(208, 31, 144)
Add "Wheat", RGB(244, 221, 178)
Add "White", RGB(255, 255, 255)
Add "WhiteSmoke", RGB(244, 244, 244)
Add "Yellow", RGB(255, 255, 0)
Add "YellowGreen", RGB(154, 205, 49)
End Sub
Norm Cook
2012-10-09 12:08:12 UTC
Permalink
Post by Schmidt
Just another extended List (not over long) of Name-Color-pairs...
(this one conforms to the ColorNames, defined in the SVG-Standard)
'***Into a Form
Option Explicit
Private SVGColorMap As New cSVGColorMap, WithEvents lstColors As ListBox
Private Sub Form_Load()
Set lstColors = Controls.Add("VB.ListBox", "lstColors")
lstColors.Move 0, 0, ScaleWidth * 0.3, ScaleHeight
lstColors.Visible = True
<Snip>
Olaf thanks for sharing. One small correction:
Looks like

Public Property Get NameByIndex$(ByVal ColorIdxZerobased As Long)
NameByIndex = mColorNames(CStr(ColorIdxZerobased))
End Property

should be named ColorNameByIndex in order for
ColorByIndex to compile.
Schmidt
2012-10-09 14:05:25 UTC
Permalink
Post by Schmidt
Public Property Get NameByIndex$(ByVal ColorIdxZerobased As Long)
NameByIndex = mColorNames(CStr(ColorIdxZerobased))
End Property
should be named ColorNameByIndex in order for
ColorByIndex to compile.
Oops, yes - thanks - I've cobbled that class together a bit,
to simulate the features of a cCollection (which is the
host for this color-list in my SVG-parser).

The error should have become apparent, when I just
had used the right Test (in the lstColors_Click-event).
As originally posted, also the test doesn't make any sense.

Here the whole (corrected) thing again with a better test:

'***Into a Test-Form
Option Explicit

Private SVGColorMap As New cSVGColorMap, WithEvents lstColors As ListBox

Private Sub Form_Load()

Set lstColors = Controls.Add("VB.ListBox", "lstColors")
lstColors.Move 0, 0, ScaleWidth * 0.3, ScaleHeight
lstColors.Visible = True

Dim i As Long
For i = 0 To SVGColorMap.Count - 1
lstColors.AddItem SVGColorMap.NameByIndex(i)
Next i
End Sub

Private Sub lstColors_Click()
Caption = lstColors.Text
BackColor = SVGColorMap.ColorByName(lstColors.Text)

'just for control-purposes (to test the ColorByIndex-Property)
If BackColor <> SVGColorMap.ColorByIndex(lstColors.ListIndex) Then Stop
End Sub

'***into a Class cSVGColorMap
Option Explicit

Private mColorNames As Collection, mColorValues As Collection

Private Sub Class_Initialize()
Set mColorNames = New Collection
Set mColorValues = New Collection
InitSVGColorMap
End Sub

Public Sub Add(ColorName As String, ByVal ColorValue As Long)
mColorNames.Add ColorName, CStr(mColorNames.Count)
mColorValues.Add ColorValue, ColorName
End Sub

Public Property Get Count() As Long
Count = mColorValues.Count
End Property

Public Property Get ColorByName&(ColorName As String)
ColorByName = mColorValues(ColorName)
End Property

Public Property Get NameByIndex$(ByVal ColorIdxZerobased As Long)
NameByIndex = mColorNames(CStr(ColorIdxZerobased))
End Property

Public Property Get ColorByIndex&(ByVal ColorIdxZerobased As Long)
ColorByIndex = mColorValues(NameByIndex(ColorIdxZerobased))
End Property

Private Sub InitSVGColorMap()
Add "AliceBlue", RGB(239, 247, 255)
Add "AntiqueWhite", RGB(249, 234, 215)
Add "Aqua", RGB(0, 255, 255)
Add "Aquamarine", RGB(126, 255, 211)
Add "Azure", RGB(239, 255, 255)
Add "Beige", RGB(244, 244, 220)
Add "Bisque", RGB(255, 227, 196)
Add "Black", RGB(0, 0, 0)
Add "BlanchedAlmond", RGB(255, 234, 205)
Add "Blue", RGB(0, 0, 255)
Add "BlueViolet", RGB(137, 43, 226)
Add "Brown", RGB(165, 42, 42)
Add "BurlyWood", RGB(221, 183, 135)
Add "CadetBlue", RGB(94, 158, 160)
Add "Chartreuse", RGB(126, 255, 0)
Add "Chocolate", RGB(210, 104, 29)
Add "Coral", RGB(255, 126, 79)
Add "CornflowerBlue", RGB(99, 149, 237)
Add "Cornsilk", RGB(255, 247, 220)
Add "Crimson", RGB(220, 20, 59)
Add "Cyan", RGB(0, 255, 255)
Add "DarkBlue", RGB(0, 0, 138)
Add "DarkCyan", RGB(0, 138, 138)
Add "DarkGoldenrod", RGB(183, 133, 11)
Add "DarkGray", RGB(169, 169, 169)
Add "DarkGreen", RGB(0, 99, 0)
Add "DarkGrey", RGB(169, 169, 169)
Add "DarkKhaki", RGB(188, 182, 107)
Add "DarkMagenta", RGB(138, 0, 138)
Add "DarkOliveGreen", RGB(84, 107, 47)
Add "DarkOrange", RGB(255, 140, 0)
Add "DarkOrchid", RGB(183, 49, 204)
Add "DarkRed", RGB(138, 0, 0)
Add "DarkSalmon", RGB(232, 150, 122)
Add "DarkSeaGreen", RGB(142, 187, 142)
Add "DarkSlateBlue", RGB(72, 61, 138)
Add "DarkSlateGray", RGB(47, 79, 79)
Add "DarkSlateGrey", RGB(47, 79, 79)
Add "DarkTurquoise", RGB(0, 206, 209)
Add "DarkViolet", RGB(147, 0, 211)
Add "DeepPink", RGB(255, 20, 146)
Add "DeepSkyBlue", RGB(0, 191, 255)
Add "DimGray", RGB(104, 104, 104)
Add "DimGrey", RGB(104, 104, 104)
Add "DodgerBlue", RGB(29, 144, 255)
Add "FireBrick", RGB(177, 33, 33)
Add "FloralWhite", RGB(255, 249, 239)
Add "ForestGreen", RGB(33, 138, 33)
Add "Fuchsia", RGB(255, 0, 255)
Add "Gainsboro", RGB(220, 220, 220)
Add "GhostWhite", RGB(247, 247, 255)
Add "Gold", RGB(255, 215, 0)
Add "Goldenrod", RGB(218, 165, 31)
Add "Gray", RGB(127, 127, 127)
Add "Green", RGB(0, 127, 0)
Add "GreenYellow", RGB(173, 255, 47)
Add "Grey", RGB(127, 127, 127)
Add "Honeydew", RGB(239, 255, 239)
Add "HotPink", RGB(255, 104, 179)
Add "IndianRed", RGB(205, 91, 91)
Add "Indigo", RGB(74, 0, 130)
Add "Ivory", RGB(255, 255, 239)
Add "Khaki", RGB(239, 229, 140)
Add "Lavender", RGB(229, 229, 249)
Add "LavenderBlush", RGB(255, 239, 244)
Add "LawnGreen", RGB(124, 252, 0)
Add "LemonChiffon", RGB(255, 249, 205)
Add "LightBlue", RGB(173, 216, 229)
Add "LightCoral", RGB(239, 127, 127)
Add "LightCyan", RGB(224, 255, 255)
Add "LightGoldenrod", RGB(237, 221, 130)
Add "LightGoldenrodYellow", RGB(249, 249, 210)
Add "LightGray", RGB(211, 211, 211)
Add "LightGreen", RGB(144, 237, 144)
Add "LightGrey", RGB(211, 211, 211)
Add "LightPink", RGB(255, 181, 192)
Add "LightSalmon", RGB(255, 160, 122)
Add "LightSeaGreen", RGB(31, 177, 170)
Add "LightSkyBlue", RGB(135, 206, 249)
Add "LightSlateBlue", RGB(132, 112, 255)
Add "LightSlateGray", RGB(119, 135, 153)
Add "LightSlateGrey", RGB(119, 135, 153)
Add "LightSteelBlue", RGB(175, 196, 221)
Add "LightYellow", RGB(255, 255, 224)
Add "Lime", RGB(0, 255, 0)
Add "LimeGreen", RGB(49, 205, 49)
Add "Linen", RGB(249, 239, 229)
Add "Magenta", RGB(255, 0, 255)
Add "Maroon", RGB(127, 0, 0)
Add "MediumAquamarine", RGB(102, 205, 170)
Add "MediumBlue", RGB(0, 0, 205)
Add "MediumOrchid", RGB(186, 84, 211)
Add "MediumPurple", RGB(146, 112, 219)
Add "MediumSeaGreen", RGB(59, 178, 113)
Add "MediumSlateBlue", RGB(123, 104, 237)
Add "MediumSpringGreen", RGB(0, 249, 154)
Add "MediumTurquoise", RGB(72, 209, 204)
Add "MediumVioletRed", RGB(198, 21, 132)
Add "MidnightBlue", RGB(24, 24, 112)
Add "MintCream", RGB(244, 255, 249)
Add "MistyRose", RGB(255, 227, 225)
Add "Moccasin", RGB(255, 227, 181)
Add "NavajoWhite", RGB(255, 221, 173)
Add "Navy", RGB(0, 0, 127)
Add "NavyBlue", RGB(0, 0, 127)
Add "OldLace", RGB(252, 244, 229)
Add "Olive", RGB(127, 127, 0)
Add "OliveDrab", RGB(107, 141, 34)
Add "Orange", RGB(255, 165, 0)
Add "OrangeRed", RGB(255, 68, 0)
Add "Orchid", RGB(218, 112, 214)
Add "PaleGoldenrod", RGB(237, 232, 170)
Add "PaleGreen", RGB(151, 251, 151)
Add "PaleTurquoise", RGB(175, 237, 237)
Add "PaleVioletRed", RGB(219, 112, 146)
Add "PapayaWhip", RGB(255, 238, 212)
Add "PeachPuff", RGB(255, 218, 184)
Add "Peru", RGB(205, 132, 63)
Add "Pink", RGB(255, 191, 202)
Add "Plum", RGB(221, 160, 221)
Add "PowderBlue", RGB(175, 224, 229)
Add "Purple", RGB(127, 0, 127)
Add "Red", RGB(255, 0, 0)
Add "RosyBrown", RGB(187, 142, 142)
Add "RoyalBlue", RGB(65, 104, 225)
Add "SaddleBrown", RGB(138, 68, 19)
Add "Salmon", RGB(249, 127, 114)
Add "SandyBrown", RGB(243, 164, 95)
Add "SeaGreen", RGB(45, 138, 86)
Add "Seashell", RGB(255, 244, 237)
Add "Sienna", RGB(160, 81, 44)
Add "Silver", RGB(191, 191, 191)
Add "SkyBlue", RGB(135, 206, 234)
Add "SlateBlue", RGB(105, 89, 205)
Add "SlateGray", RGB(112, 127, 144)
Add "SlateGrey", RGB(112, 127, 144)
Add "Snow", RGB(255, 249, 249)
Add "SpringGreen", RGB(0, 255, 126)
Add "SteelBlue", RGB(70, 130, 179)
Add "Tan", RGB(210, 179, 140)
Add "Teal", RGB(0, 127, 127)
Add "Thistle", RGB(216, 191, 216)
Add "Tomato", RGB(255, 99, 71)
Add "Turquoise", RGB(63, 224, 207)
Add "Violet", RGB(237, 130, 237)
Add "VioletRed", RGB(208, 31, 144)
Add "Wheat", RGB(244, 221, 178)
Add "White", RGB(255, 255, 255)
Add "WhiteSmoke", RGB(244, 244, 244)
Add "Yellow", RGB(255, 255, 0)
Add "YellowGreen", RGB(154, 205, 49)
End Sub

Olaf
Mayayana
2012-10-09 14:28:14 UTC
Permalink
Remind me never to have you redecorate my living room.
ForestGreen looks like grass green. LawnGreen looks
like DayGlo green, and Khaki looks like banana cream pie
crossed with lemon meringue pie. (The straight banana
cream pie being called "Moccasin".) :)
CoderX
2012-10-09 20:38:27 UTC
Permalink
Damn Olaf! No one can ever accuse you of doing anything half-assed. <g>
Post by Schmidt
Just another extended List (not over long) of Name-Color-pairs...
(this one conforms to the ColorNames, defined in the SVG-Standard)
'***Into a Form
Option Explicit
Private SVGColorMap As New cSVGColorMap, WithEvents lstColors As ListBox
Private Sub Form_Load()
Set lstColors = Controls.Add("VB.ListBox", "lstColors")
lstColors.Move 0, 0, ScaleWidth * 0.3, ScaleHeight
lstColors.Visible = True
Dim i As Long
For i = 0 To SVGColorMap.Count - 1
lstColors.AddItem SVGColorMap.NameByIndex(i)
Next i
End Sub
Private Sub lstColors_Click()
Me.BackColor = SVGColorMap.ColorByName(lstColors.Text)
'just for control-purposes (to test the NameByIndex-Property)
Me.Caption = SVGColorMap.NameByIndex(lstColors.ListIndex)
If Me.Caption <> lstColors.Text Then Stop
End Sub
'------------------------------------------------------------
'*** Into a Class cSVGColorMap
Option Explicit
Private mColorNames As Collection, mColorValues As Collection
Private Sub Class_Initialize()
Set mColorNames = New Collection
Set mColorValues = New Collection
InitSVGColorMap
End Sub
Public Sub Add(ColorName As String, ByVal ColorValue As Long)
mColorNames.Add ColorName, CStr(mColorNames.Count)
mColorValues.Add ColorValue, ColorName
End Sub
Public Property Get Count() As Long
Count = mColorValues.Count
End Property
Public Property Get ColorByName&(ColorName As String)
ColorByName = mColorValues(ColorName)
End Property
Public Property Get NameByIndex$(ByVal ColorIdxZerobased As Long)
NameByIndex = mColorNames(CStr(ColorIdxZerobased))
End Property
Public Property Get ColorByIndex&(ByVal ColorIdxZerobased As Long)
ColorByIndex = mColorValues(ColorNameByIndex(ColorIdxZerobased))
End Property
Private Sub InitSVGColorMap()
Add "AliceBlue", RGB(239, 247, 255)
Add "AntiqueWhite", RGB(249, 234, 215)
Add "Aqua", RGB(0, 255, 255)
Add "Aquamarine", RGB(126, 255, 211)
Add "Azure", RGB(239, 255, 255)
Add "Beige", RGB(244, 244, 220)
Add "Bisque", RGB(255, 227, 196)
Add "Black", RGB(0, 0, 0)
Add "BlanchedAlmond", RGB(255, 234, 205)
Add "Blue", RGB(0, 0, 255)
Add "BlueViolet", RGB(137, 43, 226)
Add "Brown", RGB(165, 42, 42)
Add "BurlyWood", RGB(221, 183, 135)
Add "CadetBlue", RGB(94, 158, 160)
Add "Chartreuse", RGB(126, 255, 0)
Add "Chocolate", RGB(210, 104, 29)
Add "Coral", RGB(255, 126, 79)
Add "CornflowerBlue", RGB(99, 149, 237)
Add "Cornsilk", RGB(255, 247, 220)
Add "Crimson", RGB(220, 20, 59)
Add "Cyan", RGB(0, 255, 255)
Add "DarkBlue", RGB(0, 0, 138)
Add "DarkCyan", RGB(0, 138, 138)
Add "DarkGoldenrod", RGB(183, 133, 11)
Add "DarkGray", RGB(169, 169, 169)
Add "DarkGreen", RGB(0, 99, 0)
Add "DarkGrey", RGB(169, 169, 169)
Add "DarkKhaki", RGB(188, 182, 107)
Add "DarkMagenta", RGB(138, 0, 138)
Add "DarkOliveGreen", RGB(84, 107, 47)
Add "DarkOrange", RGB(255, 140, 0)
Add "DarkOrchid", RGB(183, 49, 204)
Add "DarkRed", RGB(138, 0, 0)
Add "DarkSalmon", RGB(232, 150, 122)
Add "DarkSeaGreen", RGB(142, 187, 142)
Add "DarkSlateBlue", RGB(72, 61, 138)
Add "DarkSlateGray", RGB(47, 79, 79)
Add "DarkSlateGrey", RGB(47, 79, 79)
Add "DarkTurquoise", RGB(0, 206, 209)
Add "DarkViolet", RGB(147, 0, 211)
Add "DeepPink", RGB(255, 20, 146)
Add "DeepSkyBlue", RGB(0, 191, 255)
Add "DimGray", RGB(104, 104, 104)
Add "DimGrey", RGB(104, 104, 104)
Add "DodgerBlue", RGB(29, 144, 255)
Add "FireBrick", RGB(177, 33, 33)
Add "FloralWhite", RGB(255, 249, 239)
Add "ForestGreen", RGB(33, 138, 33)
Add "Fuchsia", RGB(255, 0, 255)
Add "Gainsboro", RGB(220, 220, 220)
Add "GhostWhite", RGB(247, 247, 255)
Add "Gold", RGB(255, 215, 0)
Add "Goldenrod", RGB(218, 165, 31)
Add "Gray", RGB(127, 127, 127)
Add "Green", RGB(0, 127, 0)
Add "GreenYellow", RGB(173, 255, 47)
Add "Grey", RGB(127, 127, 127)
Add "Honeydew", RGB(239, 255, 239)
Add "HotPink", RGB(255, 104, 179)
Add "IndianRed", RGB(205, 91, 91)
Add "Indigo", RGB(74, 0, 130)
Add "Ivory", RGB(255, 255, 239)
Add "Khaki", RGB(239, 229, 140)
Add "Lavender", RGB(229, 229, 249)
Add "LavenderBlush", RGB(255, 239, 244)
Add "LawnGreen", RGB(124, 252, 0)
Add "LemonChiffon", RGB(255, 249, 205)
Add "LightBlue", RGB(173, 216, 229)
Add "LightCoral", RGB(239, 127, 127)
Add "LightCyan", RGB(224, 255, 255)
Add "LightGoldenrod", RGB(237, 221, 130)
Add "LightGoldenrodYellow", RGB(249, 249, 210)
Add "LightGray", RGB(211, 211, 211)
Add "LightGreen", RGB(144, 237, 144)
Add "LightGrey", RGB(211, 211, 211)
Add "LightPink", RGB(255, 181, 192)
Add "LightSalmon", RGB(255, 160, 122)
Add "LightSeaGreen", RGB(31, 177, 170)
Add "LightSkyBlue", RGB(135, 206, 249)
Add "LightSlateBlue", RGB(132, 112, 255)
Add "LightSlateGray", RGB(119, 135, 153)
Add "LightSlateGrey", RGB(119, 135, 153)
Add "LightSteelBlue", RGB(175, 196, 221)
Add "LightYellow", RGB(255, 255, 224)
Add "Lime", RGB(0, 255, 0)
Add "LimeGreen", RGB(49, 205, 49)
Add "Linen", RGB(249, 239, 229)
Add "Magenta", RGB(255, 0, 255)
Add "Maroon", RGB(127, 0, 0)
Add "MediumAquamarine", RGB(102, 205, 170)
Add "MediumBlue", RGB(0, 0, 205)
Add "MediumOrchid", RGB(186, 84, 211)
Add "MediumPurple", RGB(146, 112, 219)
Add "MediumSeaGreen", RGB(59, 178, 113)
Add "MediumSlateBlue", RGB(123, 104, 237)
Add "MediumSpringGreen", RGB(0, 249, 154)
Add "MediumTurquoise", RGB(72, 209, 204)
Add "MediumVioletRed", RGB(198, 21, 132)
Add "MidnightBlue", RGB(24, 24, 112)
Add "MintCream", RGB(244, 255, 249)
Add "MistyRose", RGB(255, 227, 225)
Add "Moccasin", RGB(255, 227, 181)
Add "NavajoWhite", RGB(255, 221, 173)
Add "Navy", RGB(0, 0, 127)
Add "NavyBlue", RGB(0, 0, 127)
Add "OldLace", RGB(252, 244, 229)
Add "Olive", RGB(127, 127, 0)
Add "OliveDrab", RGB(107, 141, 34)
Add "Orange", RGB(255, 165, 0)
Add "OrangeRed", RGB(255, 68, 0)
Add "Orchid", RGB(218, 112, 214)
Add "PaleGoldenrod", RGB(237, 232, 170)
Add "PaleGreen", RGB(151, 251, 151)
Add "PaleTurquoise", RGB(175, 237, 237)
Add "PaleVioletRed", RGB(219, 112, 146)
Add "PapayaWhip", RGB(255, 238, 212)
Add "PeachPuff", RGB(255, 218, 184)
Add "Peru", RGB(205, 132, 63)
Add "Pink", RGB(255, 191, 202)
Add "Plum", RGB(221, 160, 221)
Add "PowderBlue", RGB(175, 224, 229)
Add "Purple", RGB(127, 0, 127)
Add "Red", RGB(255, 0, 0)
Add "RosyBrown", RGB(187, 142, 142)
Add "RoyalBlue", RGB(65, 104, 225)
Add "SaddleBrown", RGB(138, 68, 19)
Add "Salmon", RGB(249, 127, 114)
Add "SandyBrown", RGB(243, 164, 95)
Add "SeaGreen", RGB(45, 138, 86)
Add "Seashell", RGB(255, 244, 237)
Add "Sienna", RGB(160, 81, 44)
Add "Silver", RGB(191, 191, 191)
Add "SkyBlue", RGB(135, 206, 234)
Add "SlateBlue", RGB(105, 89, 205)
Add "SlateGray", RGB(112, 127, 144)
Add "SlateGrey", RGB(112, 127, 144)
Add "Snow", RGB(255, 249, 249)
Add "SpringGreen", RGB(0, 255, 126)
Add "SteelBlue", RGB(70, 130, 179)
Add "Tan", RGB(210, 179, 140)
Add "Teal", RGB(0, 127, 127)
Add "Thistle", RGB(216, 191, 216)
Add "Tomato", RGB(255, 99, 71)
Add "Turquoise", RGB(63, 224, 207)
Add "Violet", RGB(237, 130, 237)
Add "VioletRed", RGB(208, 31, 144)
Add "Wheat", RGB(244, 221, 178)
Add "White", RGB(255, 255, 255)
Add "WhiteSmoke", RGB(244, 244, 244)
Add "Yellow", RGB(255, 255, 0)
Add "YellowGreen", RGB(154, 205, 49)
End Sub
Ulrich Korndoerfer
2012-10-09 21:05:43 UTC
Permalink
Hi,
Post by Schmidt
Just another extended List (not over long) of Name-Color-pairs...
(this one conforms to the ColorNames, defined in the SVG-Standard)
Those are the same usable with Html (understood by browsers). Some of
them I really like because of their nice names, like Peachpuff (big
grin), Chartreuse (gimmy a drink ) etc.

:-)
--
Ulrich Korndoerfer

VB tips, helpers, solutions -> http://www.prosource.de/Downloads/
MS Newsgruppen Alternativen -> http://www.prosource.de/ms-ng-umzug.html
Mike Williams
2012-10-08 21:42:13 UTC
Permalink
Post by -mhd
Post by Jeff Johnson
Try http://www.blacksunsoftware.com/screenmagnifier.html
It'll tell you the color value of the pixel under the cursor.
I don't think any of those utilities (I have a few) give the long
rgb value but rather the RGB separate values.
Well write your own then. It's fairly straightforward. As an example, paste
the following code into a VB Form containing one Timer control.

Mike

Option Explicit
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetDC Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" _
(ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Private Declare Function GetDesktopWindow _
Lib "user32" () As Long
Private Declare Function GetPixel Lib "gdi32" _
(ByVal hdc As Long, ByVal x As Long, _
ByVal y As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Const SWP_NOSIZE As Long = &H1&
Private Const SWP_NOMOVE As Long = &H2&
Private Const HWND_TOPMOST As Long = -1&
Private mypointer As POINTAPI
Private DesktopDC As Long

Private Sub Form_Load()
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 360, 0, _
SWP_NOMOVE
End Sub

Private Sub Timer1_Timer()
Dim retval As Long, s1 As String
DesktopDC = GetDC(0&)
' get mouse x, y coordinates
GetCursorPos mypointer ' cursor x,y position
retval = GetPixel(DesktopDC, mypointer.x, mypointer.y)
s1 = s1 & " R " & Format(retval And &HFF)
s1 = s1 & " : G " & Format((retval \ &H100&) And &HFF)
s1 = s1 & " : B " & Format((retval \ &H10000) And &HFF)
s1 = s1 & " : " & "&H" & Right$("000000" & Hex$(retval), 6)
Caption = s1
ReleaseDC GetDesktopWindow, DesktopDC
End Sub
Mike Williams
2012-10-08 21:49:24 UTC
Permalink
Post by Mike Williams
Well write your own then. It's fairly straightforward. As an
example, paste the following code into a VB Form containing
one Timer control.
Oops! Missed a bit! Forgot to initialise the Timer. Amend the load Event
code so that it is as follows:

Private Sub Form_Load()
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 360, 0, _
SWP_NOMOVE
Timer1.Interval = 100
Timer1.Enabled = True
End Sub

Mike
-mhd
2012-10-09 00:15:52 UTC
Permalink
Post by Mike Williams
Post by Mike Williams
Well write your own then. It's fairly straightforward. As an
example, paste the following code into a VB Form containing
one Timer control.
Oops! Missed a bit! Forgot to initialise the Timer. Amend the load Event
Private Sub Form_Load()
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 360, 0, _
SWP_NOMOVE
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Mike
Mike - that is a very useful utility to have on hand. Thanks very much for this.

-mhd
Deanna Earley
2012-10-09 08:30:39 UTC
Permalink
Post by -mhd
I don't think any of those utilities (I have a few) give the long rgb value but
rather the RGB separate values. I suppose I could drum up a quick app that has
the common font dialog control and debug print the returned color values.
Or just call the RGB() function.
--
Deanna Earley (***@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
Jeff Johnson
2012-10-09 17:52:00 UTC
Permalink
Post by -mhd
Post by Jeff Johnson
Try http://www.blacksunsoftware.com/screenmagnifier.html
It'll tell you the color value of the pixel under the cursor.
I don't think any of those utilities (I have a few) give the long rgb value but
rather the RGB separate values.
Clearly you didn't even go to the site and look at the screenshot....

And even if they give the separate values, so what? Is it THAT hard to work
out the long values?
DaveO
2012-10-09 10:57:44 UTC
Permalink
Post by -mhd
I'm now rolling my own font dialog and want to match the list of 16 colors used
by the color dropbox in the MS font common dialog.
The color names in the MS version do not match the 16 QBCcolors so where can I
get the long rgb values of these colors? I sure would like to find a reference
(I Googled) but I am coming up short.
-mike
Am I right to assume you intend to provide a combo box with the names of the
colours?
Not the best interface as the names are a bit arbitary, far better to have a
combo box with bars of each colour so they can be chosen directly. The
combobox does not provide that functionality out-of-the-box but it's not too
tricky to manage (or so I'm led to understand, I've seen it but I've not
actually tried it myself). Googling of "vb6 colour picker" only returned
23,900 results but I'm sure one or two of them will do exactly what you
need.

Regards
DaveO
DaveO
2012-10-09 14:21:44 UTC
Permalink
Post by DaveO
Am I right to assume you intend to provide a combo box with the names of
the colours?
Not the best interface as the names are a bit arbitary, far better to have
a combo box with bars of each colour so they can be chosen directly. The
combobox does not provide that functionality out-of-the-box but it's not
too tricky to manage (or so I'm led to understand, I've seen it but I've
not actually tried it myself). Googling of "vb6 colour picker" only
returned 23,900 results but I'm sure one or two of them will do exactly
what you need.
Hi again, I looked at some of them but I then worked out the really easiest
method of all but it needs "Microsoft WIndows Common Controls 6.0 (SP6)" to
be selected in components.
Simply make a 16x16 icon of each colour required and load them along with
the names you have already determined into a ImageCombo (Locked = True) -
job done!

Regards
DaveO.
-mhd
2012-10-09 17:10:13 UTC
Permalink
Post by DaveO
Hi again, I looked at some of them but I then worked out the really easiest
method of all but it needs "Microsoft WIndows Common Controls 6.0 (SP6)" to
be selected in components.
Simply make a 16x16 icon of each colour required and load them along with
the names you have already determined into a ImageCombo (Locked = True) -
job done!
I'm using Codejock controls otherwise normal theming methods do not work from
within Outlook addins.

-mhd
-mhd
2012-10-09 16:58:59 UTC
Permalink
Post by DaveO
Am I right to assume you intend to provide a combo box with the names of the
colours?
Not the best interface as the names are a bit arbitary, far better to have a
combo box with bars of each colour so they can be chosen directly.
The 16 names used by MS in their Font common dialog are well established and
don't seem arbitrary to me. Remember I am rolling my own dialog for fonts and
Windows users have been seeing these same color names for years.

I would love to have the color bars in my combobox but owner drawing Codejock
themed controls could be a headache with no help from Codejock.
Post by DaveO
The
combobox does not provide that functionality out-of-the-box but it's not too
tricky to manage (or so I'm led to understand, I've seen it but I've not
actually tried it myself). Googling of "vb6 colour picker" only returned
23,900 results but I'm sure one or two of them will do exactly what you
need.
I Googled and Googled and it seems that VB6 means .net to Google. Trying to get
a color picker in the context of being within the Font dialog and not a full
blown color dialog doesn't leave much to pick from either. Plus I wasn't looking
for a code sample - just wanted info on what the difference is between QBColor
names and the names used in font dialogs which is now resolved.

Anyway my custom dialog is now working just the way I like it (minus the bonus
color bars).

-mhd
-mhd
2012-10-09 19:14:23 UTC
Permalink
Post by -mhd
I would love to have the color bars in my combobox but owner drawing Codejock
themed controls could be a headache with no help from Codejock.
Actually it seems that newer versions of their controls support this but license
renewal is expensive for that one missing feature.

-mhd
Mayayana
2012-10-09 21:33:38 UTC
Permalink
Post by -mhd
I would love to have the color bars in my combobox but owner drawing Codejock
themed controls could be a headache with no help from Codejock.
I don't know anything about Codejock, but I know
there are samples around for drawing colors in listboxes.
I use code like that myself to put a colored block on
the left of each item and shift the text over. One
just has to trap the WM_DRAWITEM message and then
draw the item content "by hand". It may be that under
the hood the Codejock control is using a Windows window
that you can do that with.
-mhd
2012-10-09 21:49:45 UTC
Permalink
Post by Mayayana
Post by -mhd
I would love to have the color bars in my combobox but owner drawing Codejock
themed controls could be a headache with no help from Codejock.
I don't know anything about Codejock, but I know
there are samples around for drawing colors in listboxes.
I use code like that myself to put a colored block on
the left of each item and shift the text over. One
just has to trap the WM_DRAWITEM message and then
draw the item content "by hand". It may be that under
the hood the Codejock control is using a Windows window
that you can do that with.
I'll play with that and see its doable.

-Maurice

Stan Weiss
2012-10-09 17:09:29 UTC
Permalink
Some thing that I got about 4 1/2 year ago probable from this news
group. I have no used the code only some of the colors.

Stan

Private Function GetColourName(lColour As Long) As String
Dim S As String
Select Case lColour
Case 16775408: S = "Alice Blue" 'HEX F0F8FF: RGB(240, 248, 255)
Case 14150650: S = "Antique White" 'HEX FAEBD7: RGB(250, 235, 215)
Case 16776960: S = "Aqua" 'HEX 00FFFF: RGB(0, 255, 255)
Case 13959039: S = "Aquamarine" 'HEX 7FFFD4: RGB(127, 255, 212)
Case 16777200: S = "Azure" 'HEX F0FFFF: RGB(240, 255, 255)
Case 14480885: S = "Beige" 'HEX F5F5DC: RGB(245, 245, 220)
Case 12903679: S = "Bisque" 'HEX FFE4C4: RGB(255, 228, 196)
Case 0: S = "Black" 'HEX 000000: RGB(0, 0, 0)
Case 13495295: S = "Blanched Almond" 'HEX FFEBCD: RGB(255, 235, 205)
Case 16711680: S = "Blue" 'HEX 0000FF: RGB(0, 0, 255)
Case 14822282: S = "Blue Violet" 'HEX 8A2BE2: RGB(138, 43, 226)
Case 2763429: S = "Brown" 'HEX A52A2A: RGB(165, 42, 42)
Case 8894686: S = "Burly Wood" 'HEX DEB887: RGB(222, 184, 135)
Case 10526303: S = "Cadet Blue" 'HEX 5F9EA0: RGB(95, 158, 160)
Case 65407: S = "Chartreuse" 'HEX 7FFF00: RGB(127, 255, 0)
Case 1993170: S = "Chocolate" 'HEX D2691E: RGB(210, 105, 30)
Case 5275647: S = "Coral" 'HEX FF7F50: RGB(255, 127, 80)
Case 15570276: S = "Cornflower Blue" 'HEX 6495ED: RGB(100, 149, 237)
Case 14481663: S = "Cornsilk" 'HEX FFF8DC: RGB(255, 248, 220)
Case 4039917: S = "Crimson" 'HEX DC143C: RGB(237, 164, 61)
Case 16776960: S = "Cyan" 'HEX 00FFFF: RGB(0, 255, 255)
Case 9109504: S = "Dark Blue" 'HEX 00008B: RGB(0, 0, 139)
Case 9145088: S = "Dark Cyan" 'HEX 008B8B: RGB(0, 139, 139)
Case 755384: S = "Dark Golden Rod" 'HEX B8860B: RGB(184, 134, 11)
Case 11119017: S = "Dark Gray" 'HEX A9A9A9: RGB(169, 169, 169)
Case 25600: S = "Dark Green" 'HEX 006400: RGB(0, 100, 0)
Case 7059389: S = "Dark Khaki" 'HEX BDB76B: RGB(189, 183, 107)
Case 9109643: S = "Dark Magenta" 'HEX 8B008B: RGB(139, 0, 139)
Case 3107669: S = "Dark Olive Green" 'HEX 556B2F: RGB(85, 107, 47)
Case 36095: S = "Dark orange" 'HEX FF8C00: RGB(255, 140, 0)
Case 13382297: S = "Dark Orchid" 'HEX 9932CC: RGB(153, 50, 204)
Case 139: S = "Dark Red" 'HEX 8B0000: RGB(139, 0, 0)
Case 8034025: S = "Dark Salmon" 'HEX E9967A: RGB(233, 150, 122)
Case 9419919: S = "Dark Sea Green" 'HEX 8FBC8F: RGB(143, 188, 143)
Case 9125192: S = "Dark Slate Blue" 'HEX 483D8B: RGB(72, 61, 139)
Case 5197615: S = "Dark Slate Gray" 'HEX 2F4F4F: RGB(47, 79, 79)
Case 13749760: S = "Dark Turquoise" 'HEX 00CED1: RGB(0, 206, 209)
Case 13828244: S = "Dark Violet" 'HEX 9400D3: RGB(148, 0, 211)
Case 9639167: S = "Deep Pink" 'HEX FF1493: RGB(255, 20, 147)
Case 16760576: S = "Deep Sky Blue" 'HEX 00BFFF: RGB(0, 191, 255)
Case 6908265: S = "Dim Gray" 'HEX 696969: RGB(105, 105, 105)
Case 16748574: S = "Dodger Blue" 'HEX 1E90FF: RGB(30, 144, 255)
Case 2237106: S = "Fire Brick" 'HEX B22222: RGB(178, 34, 34)
Case 15792895: S = "Floral White" 'HEX FFFAF0: RGB(255, 250, 240)
Case 2263842: S = "Forest Green" 'HEX 228B22: RGB(34, 139, 34)
Case 16711935: S = "Fuchsia" 'HEX FF00FF: RGB(255, 0, 255)
Case 14474460: S = "Gainsboro" 'HEX DCDCDC: RGB(220, 220, 220)
Case 16775416: S = "Ghost White" 'HEX F8F8FF: RGB(248, 248, 255)
Case 55295: S = "Gold" 'HEX FFD700: RGB(255, 215, 0)
Case 2139610: S = "Golden Rod" 'HEX DAA520: RGB(218, 165, 32)
Case 8421504: S = "Gray" 'HEX 808080: RGB(128, 128, 128)
Case 32768: S = "Green" 'HEX 008000: RGB(0, 128, 0)
Case 3145645: S = "Green Yellow" 'HEX ADFF2F: RGB(173, 255, 47)
Case 15794160: S = "HoneyDew" 'HEX F0FFF0: RGB(240, 255, 240)
Case 11823615: S = "Hot Pink" 'HEX FF69B4: RGB(255, 105, 180)
Case 6053069: S = "Indian Red" 'HEX CD5C5C: RGB(205, 92, 92)
Case 8519755: S = "Indigo" 'HEX 4B0082: RGB(75, 0, 130)
Case 15794175: S = "Ivory" 'HEX FFFFF0: RGB(255, 255, 240)
Case 9234160: S = "Khaki" 'HEX F0E68C: RGB(240, 230, 140)
Case 16443110: S = "Lavender" 'HEX E6E6FA: RGB(230, 230, 250)
Case 16118015: S = "Lavender Blush" 'HEX FFF0F5: RGB(255, 240, 245)
Case 64636: S = "Lawn Green" 'HEX 7CFC00: RGB(124, 252, 0)
Case 13499135: S = "Lemon Chiffon" 'HEX FFFACD: RGB(255, 250, 205)
Case 15128749: S = "Light Blue" 'HEX ADD8E6: RGB(173, 216, 230)
Case 8421616: S = "Light Coral" 'HEX F08080: RGB(240, 128, 128)
Case 16777184: S = "Light Cyan" 'HEX E0FFFF: RGB(224, 255, 255)
Case 13826810: S = "Light Golden Rod Yellow " 'HEX FAFAD2: RGB(250, 250,
210)
Case 13882323: S = "Light Gray" 'HEX D3D3D3: RGB(211, 211, 211)
Case 9498256: S = "Light Green" 'HEX 90EE90: RGB(144, 238, 144)
Case 12695295: S = "Light Pink" 'HEX FFB6C1: RGB(255, 182, 193)
Case 8036607: S = "Light Salmon" 'HEX FFA07A: RGB(255, 160, 122)
Case 11186720: S = "Light Sea Green" 'HEX 20B2AA: RGB(32, 178, 170)
Case 16436871: S = "Light Sky Blue" 'HEX 87CEFA: RGB(135, 206, 250)
Case 10061943: S = "Light Slate Gray" 'HEX 778899: RGB(119, 136, 153)
Case 14599344: S = "Light Steel Blue" 'HEX B0C4DE: RGB(176, 196, 222)
Case 14745599: S = "Light Yellow" 'HEX FFFFE0: RGB(255, 255, 224)
Case 65280: S = "Lime" 'HEX 00FF00: RGB(0, 255, 0)
Case 3329330: S = "Lime Green" 'HEX 32CD32: RGB(50, 205, 50)
Case 15134970: S = "Linen" 'HEX FAF0E6: RGB(250, 240, 230)
Case 16711935: S = "Magenta" 'HEX FF00FF: RGB(255, 0, 255)
Case 128: S = "Maroon" 'HEX 800000: RGB(128, 0, 0)
Case 11193702: S = "Medium Aqua Marine" 'HEX 66CDAA: RGB(102, 205, 170)
Case 13434880: S = "Medium Blue" 'HEX 0000CD: RGB(0, 0, 205)
Case 13850042: S = "Medium Orchid" 'HEX BA55D3: RGB(186, 85, 211)
Case 14381203: S = "Medium Purple" 'HEX 9370D8: RGB(147, 112, 219)
Case 7451452: S = "Medium Sea Green" 'HEX 3CB371: RGB(60, 179, 113)
Case 15624315: S = "Medium Slate Blue" 'HEX 7B68EE: RGB(123, 104, 238)
Case 10156544: S = "Medium Spring Green" 'HEX 00FA9A: RGB(0, 250, 154)
Case 13422920: S = "Medium Turquoise" 'HEX 48D1CC: RGB(72, 209, 204)
Case 8721863: S = "Medium Violet Red" 'HEX C71585: RGB(199, 21, 133)
Case 7346457: S = "Midnight Blue" 'HEX 191970: RGB(25, 25, 112)
Case 16449525: S = "Mint Cream" 'HEX F5FFFA: RGB(245, 255, 250)
Case 14804223: S = "Misty Rose" 'HEX FFE4E1: RGB(255, 228, 225)
Case 11920639: S = "Moccasin" 'HEX FFE4B5: RGB(255, 228, 181)
Case 11394815: S = "Navajo White" 'HEX FFDEAD: RGB(255, 222, 173)
Case 8388608: S = "Navy" 'HEX 000080: RGB(0, 0, 128)
Case 15136253: S = "Old Lace" 'HEX FDF5E6: RGB(253, 245, 230)
Case 32896: S = "Olive" 'HEX 808000: RGB(128, 128, 0)
Case 2330219: S = "Olive Drab" 'HEX 6B8E23: RGB(107, 142, 35)
Case 42495: S = "Orange" 'HEX FFA500: RGB(255, 165, 0)
Case 17919: S = "Orange Red" 'HEX FF4500: RGB(255, 69, 0)
Case 14053594: S = "Orchid" 'HEX DA70D6: RGB(218, 112, 214)
Case 11200750: S = "Pale GoldenRod" 'HEX EEE8AA: RGB(238, 232, 170)
Case 10025880: S = "Pale Green" 'HEX 98FB98: RGB(152, 251, 152)
Case 15658671: S = "Pale Turquoise" 'HEX AFEEEE: RGB(175, 238, 238)
Case 9662683: S = "Pale Violet Red" 'HEX D87093: RGB(219, 112, 147)
Case 14020607: S = "Papaya Whip" 'HEX FFEFD5: RGB(255, 239, 213)
Case 12180223: S = "Peach Puff" 'HEX FFDAB9: RGB(255, 218, 185)
Case 4163021: S = "Peru" 'HEX CD853F: RGB(205, 133, 63)
Case 13353215: S = "Pink" 'HEX FFC0CB: RGB(255, 192, 203)
Case 14524637: S = "Plum" 'HEX DDA0DD: RGB(221, 160, 221)
Case 15130800: S = "Powder Blue" 'HEX B0E0E6: RGB(176, 224, 230)
Case 8388736: S = "Purple" 'HEX 800080: RGB(128, 0, 128)
Case 255: S = "Red" 'HEX FF0000: RGB(255, 0, 0)
Case 9408444: S = "Rosy Brown" 'HEX BC8F8F: RGB(188, 143, 143)
Case 14772545: S = "Royal Blue" 'HEX 4169E1: RGB(65, 105, 225)
Case 1262987: S = "Saddle Brown" 'HEX 8B4513: RGB(139, 69, 19)
Case 7504122: S = "Salmon" 'HEX FA8072: RGB(250, 128, 114)
Case 6333684: S = "Sandy Brown" 'HEX F4A460: RGB(244, 164, 96)
Case 5737262: S = "Sea Green" 'HEX 2E8B57: RGB(46, 139, 87)
Case 15660543: S = "Sea Shell" 'HEX FFF5EE: RGB(255, 245, 238)
Case 2970272: S = "Sienna" 'HEX A0522D: RGB(160, 82, 45)
Case 12632256: S = "Silver" 'HEX C0C0C0: RGB(192, 192, 192)
Case 15453831: S = "Sky Blue" 'HEX 87CEEB: RGB(135, 206, 235)
Case 13458026: S = "Slate Blue" 'HEX 6A5ACD: RGB(106, 90, 205)
Case 9470064: S = "Slate Gray" 'HEX 708090: RGB(112, 128, 144)
Case 16448255: S = "Snow" 'HEX FFFAFA: RGB(255, 250, 250)
Case 8388352: S = "Spring Green" 'HEX 00FF7F: RGB(0, 255, 127)
Case 11829830: S = "Steel Blue" 'HEX 4682B4: RGB(70, 130, 180)
Case 9221330: S = "Tan" 'HEX D2B48C: RGB(210, 180, 140)
Case 8421376: S = "Teal" 'HEX 008080: RGB(0, 128, 128)
Case 14204888: S = "Thistle" 'HEX D8BFD8: RGB(216, 191, 216)
Case 4678655: S = "Tomato" 'HEX FF6347: RGB(255, 99, 71)
Case 13688896: S = "Turquoise" 'HEX 40E0D0: RGB(64, 224, 208)
Case 15631086: S = "Violet" 'HEX EE82EE: RGB(238, 130, 238)
Case 11788021: S = "Wheat" 'HEX F5DEB3: RGB(245, 222, 179)
Case 16777215: S = "White" 'HEX FFFFFF: RGB(255, 255, 255)
Case 16119285: S = "White Smoke" 'HEX F5F5F5: RGB(245, 245, 245)
Case 65535: S = "Yellow" 'HEX FFFF00: RGB(255, 255, 0)
Case 3329434: S = "Yellow Green" 'HEX 9ACD32: RGB(154, 205, 50)
Case Else: S = "Unknown Colour"
End Select
GetColourName = S
End Function
Post by -mhd
I'm now rolling my own font dialog and want to match the list of 16 colors used
by the color dropbox in the MS font common dialog.
The color names in the MS version do not match the 16 QBCcolors so where can I
get the long rgb values of these colors? I sure would like to find a reference
(I Googled) but I am coming up short.
-mike
Loading...