View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Obtain current RGB settings for color indexes 17 thru 27

What exactly do you want to retrieve, the separate red green blue
components, the colour value, or what? Separate cells, all in one? How will
you pass the colour to be evaluated?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"quartz" wrote in message
...
Thanks Bob.
Forgive my ignorance, but how can I get this info into cells in a sheet?


"Bob Phillips" wrote:

Sub test()
Dim red, green, blue
GetRGB ActiveWorkbook.Colors(17), red, green, blue
Debug.Print red
Debug.Print green
Debug.Print blue
End Sub

Public Function GetRGB(colour As Long, ByRef red, ByRef green, ByRef

blue)

red = colour And &HFF
green = colour \ 256 And &HFF
blue = colour \ 256 ^ 2 And &HFF

End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"quartz" wrote in message
...
I am using Office 2003 on Windows XP.

I want to retrieve the current color mix values (RGB) for the current

user
of an Excel file (for index 17 through 27) and store these settings in

a
hidden sheet. I then plan to add some custom color mixes for use with

a
program, then restore the user's original colors when the user exits

the
file.

Does anyone have a function that will retrieve the current color mixes
(RGB)? If so, could you please post example code or a function?

(Please
note
that I already know how to custom mix the colors and add them to the

palette,
access them, etc). OR if someone has an easier solution to this issue,

please
post any suggestions...

Thanks much in advance.