RGB Codes for 90% Black

  • Thread starter Thread starter ju2908
  • Start date Start date
J

ju2908

Hi

I have to have to change the font colour of text in Word in 90% black and
70% black.
I can't find the corect rgb codes for these

Can any one help
thanks
ju
 
25, 25, 25

76, 76, 76

You can set those two with a builtin in constant:

Selection.Font.Color = wdColorGray90

or

Selection.Font.Color = wdColorGray70

With any text selected you can determine the Long and RBG data with the
following macro:

Sub Test()
Dim oRng As Word.Range
Dim oColorLng As Long
Dim rVal As Long
Dim gVal As Long
Dim bVal As Long
Dim oColorRBG As String
Set oRng = Selection.Range
With oRng
oColorLng = oRng.Font.Color
rVal = oColorLng Mod 256
bVal = Int(oColorLng / 65536)
gVal = Int((oColorLng - (bVal * 65536) - rVal) / 256)
oColorRBG = CStr(rVal) & ", " & CStr(gVal) & ", " & CStr(bVal)
MsgBox "Long value: " & oColorLng & vbCr & vbCr & _
"RBG value: (" & oColorRBG & ")", vbInformation, "Chosen Color
Data"
End With
End Sub
 
Hi

I have to have to change the font colour of text in Word in 90% black and
70% black.
I can't find the corect rgb codes for these

Can any one help
thanks
ju

Try RGB(26, 26, 26) for 90% black. It's close (an exact value would be 25.6 for
each number, but Word can't do fractions). But I think you'll find it's
generally indistinguishable from 100% black.

For 70%, use RGB(77, 77, 77).
 
You don't say what Word version you are using but there are several shades
of grey available on the More Colors dialog, Standard tab (and equivalent
VBA constants available, if you want to use code). If you want to explicitly
set a percentage of Black, then this is how to calculate he RGB values:

100% Black = 0, 0, 0
0% Black = 255, 255, 255

thus each 1% less than 100% black is 2.55, 2.55, 2.55
rounding to whole numbers means that:
99% black is 3, 3, 3
98% black is 5, 5, 5
...
90% black is 25, 25, 25
...
70% black is 77, 77, 77
...
etc.

Now, if you happen to be using Word 2007 and want to use Theme colours
rather than the explicit black, see
http://www.wordarticles.com/Articles/Colours/2007.htm where I have written
more than I should - although probably not enough - about how it works.
 
Tony Jollans said:
You don't say what Word version you are using but there are several shades
of grey available on the More Colors dialog, Standard tab (and equivalent
VBA constants available, if you want to use code). If you want to explicitly
set a percentage of Black, then this is how to calculate he RGB values:

100% Black = 0, 0, 0
0% Black = 255, 255, 255

thus each 1% less than 100% black is 2.55, 2.55, 2.55
rounding to whole numbers means that:
99% black is 3, 3, 3
98% black is 5, 5, 5
...
90% black is 25, 25, 25
...
70% black is 77, 77, 77
...
etc.

Now, if you happen to be using Word 2007 and want to use Theme colours
rather than the explicit black, see
http://www.wordarticles.com/Articles/Colours/2007.htm where I have written
more than I should - although probably not enough - about how it works.

--
Enjoy,
Tony

www.WordArticles.com

It's word 2003

Thanks very much. Does the same apply to 80% cyan?

Thanks

Ju
 
To add to what all the others have said:

In the Font Color palette, the rightmost column of color squares is shades
of gray, and these do have ScreenTips: 80%, 50%, 40%, and 25% black. You
could select one of these and see where it falls on the More Colors |
Standard range, which offers 13 gradations between white and black. Choosing
the Custom tab will give the RGB codes for any of these.

For further accuracy, you can use the Borders and Shading dialog. Choose the
Shading tab, and there you will have color squares for shading in 5% (and
sometimes 2.5%) increments. If you select 90% and then go to More Colors |
Custom, you'll see that the code is 25, 25, 25. For 70%, it is 76, 76, 76.
These same formulas will work for font color.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
Back
Top