Is There A Command To Convert Hex-colors?

Hi there!

To get Colors from eg. Photoshop into Maya I always have to take the calculator and type in the R, G and B values seperately, divide them by 255 and put them in one by one. (when I want the color to be 0 to 1, I know I can turn the color chooser to 0 to 255) Or I pull my Maya window aside and pick a color from Photoshop, then put all windows where they belong again (Alt-Tab doesn't work with the color picker, it always returns white.) And picking works only from PS to Maya. The PS picker isn't that smart :confused:

however. In PS there that Hex field. And it whould save a lot of time If I simply could use that number!

And BTW: Is there a way to edit the Maya Color Chooser? I can't find it in the Maya scripts. Don't tell me its programmed
Between the 2 optionMenus RGB and 0to 255 in color chooser is still space for such a field.

I have this problem, and the only way I've come up with so far is to write a little proc for myself:

CODE
global proc float[] convertRGB(float $rgb[])
{
    float $result[3];
    for ($n=0; $n<3; $n++)

Hey Naughty!

So nothing Maya-Build in right? :[ hmm...
Hope its not too complicated..

Yea editing the Color Chooser:
You Know how it looks. What about putting a Hex-field right there:
400) {this.resized=true; this.width=400; this.alt='Click here to open new window';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(this.resized) {window.open('http://show.imagehosting.us/show/722959/0/nouser_722/T0_-1_722959.jpg');}" />

Hum.. nice Idea. But first we need something to calculate the Number from Hex to 3 flaots and vice versa ;]

I got bored so I wrote this (in about 5 mins.. now I'm bored again.. )

CODE
proc int getDecFromHex(string $char)
{
    string $h = tolower($char);
    if ($h == "a")    return 10;
    if ($h == "b")    return 11;
    if ($h == "c")    return 12;
    if ($h == "d")    return 13;
    if ($h == "e")    return 14;
    if ($h == "f")    return 15;
    return (int($h));
}
global proc int[] hexCalc(string $hex)
{
    int $dec[];
    for ($f=1; $f<size($hex); $f=$f+2)
    {

Whooarrr! Hehe COOL!

It works! And thats ingenious in my eyes!!

Now I gotta new task for you:
Find a way to edit the friggling Color Chooser. But I crawled the Maya scripts: No hit for "color chooser" (wich is the Title of the window) and neither "wheel" can be found (a frame is called so there) :[
Where is that window build? I mean.. there are a lot of special controls inside. But it looks like MEL. Maybe they really programmed it. shrug

But thanks for the script! I gonna put it to my defaults