Color Data Type Conversion?

Hi,
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 = c.red Dim g as integer = c.green Dim b as integer = c.blue

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.

right("000000"+str(c),6)

seems to work as well