Tuesday, October 12, 2010

Poping color selection window.

Here is an interesting piece of code for poping color selection window.
 
static void colors(Args _args)
{
    #DEFINE.COLORVALUE (64)
    int             r, g, b;
    container       chosenColor;
    Binary          customColors        = new Binary(#COLORVALUE);
    CCColor         colorValue;

    chosenColor = WinAPI::chooseColor(infolog.hWnd(), r, g, b, customColors, true);
    if (chosenColor)
    {
        [r, g, b] = chosenColor;
        colorValue  = WinAPI::RGB2int(r, g, b);
        print (colorValue);
        pause;
    }
}
 
Below is the window that pops up
untitled

No comments: