Re: wxEuphoria - color_selector()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jerry Story wrote:
> 
> Jesse Adkins wrote:
> > 
> > Jerry Story wrote:
> > > 
> > > Bernie Ryan wrote:
> > > > You will probably have to save the three color values in an ini file.
> > > > 
> > > > Then when your program starts do a  
> > > >    skin = create(wxColour,{red,green,blue})
> > > 
> > > The question boils down to:
> > > how to get the 3 colors from color_selector()?
> > 
> > Instead of trying to get the value from the color selector, why not try 
> > grabbing the values of the colors since they're easier to work with?
> > 
> > Something like printf might work for what you're trying to do.
> > 
> > printf ( FILE, "%d,%d,%d", {Red,Green,Blue})
> > 
> > Hope that helps.
> 
> How do I get red,green,blue?
> I know how to do everything else.

 From the win32lib library ...

-----------------------------------------------------------------------------
--/topic Graphics
--/func split_rgb( object pColor)
--/desc Convert a color into a {red, green, blue}.
--/ret Sequence: 3-element {RED, GREEN, BLUE}
-- Converts the color value into its component colors.
--
-- Example:
-- /code
--      -- get the colors got a pixel
--      RGB = split_rgb( getPixel(myBMP, 4,7) )
--      RGB = split_rgb( "BrightCyan" )
--      RGB = split_rgb( COLOR_BUTTONFACE )
--      RGB = split_rgb( Magenta )
-- /endcode
atom gColors gColors = allocate_mem(4)
global function split_rgb( object pColor )
    poke4(gColors, colorValue(pColor))
    return peek({gColors,3})
end function


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu