Color Data Type Conversion?

I am using the code below to display the OS color picker window - allowing the user to select a color.

dim c as color call selectColor(c, "") SelectedMouseColor = c

What I am now stuck with is:

  1. How to retrieve JUST the RGB code for c
  2. How to retrieve JUST the Hex code for c

I basically need two text fields - one with just the RGB value, and the other with just the Hex value.
Hope that made sense.

Any help would be much appreciated.

Thank you all in advance.

Hex is just the rub value in an encoded state.

dim r as integer = Dim g as integer = Dim b as integer =

I usually use Right to generate the hex values:

right("0"+hex( r ),2) + right("0"+hex( g ),2) + right("0"+hex( b ),2)

Thank you Greg - I will try that!
Much appreciated.


seems to work as well