The issue I am having is that I added a GlowFilter to a label and I need to
allow it to be styled in CSS.

So in my code read in my style like:

var glowRGB:uint = getStyle( "textGlowColor" );
glowFilter.color = glowRGB;

But this fails because glowFilter.color wants a HEX color. I just seemed
strange that I did not have a utility function to do the conversion for me
and it seemed like basic functionality.

I am not big on bit wise operations and shifting and when I see those
examples it scares me as I am not used to doing it.

So, if the best thing for me to do is just "write that shifing code" I will
:-). But if there is a handy converstion function in the SDK, please show
me.

Thanks,

Greg


On Wed, Sep 30, 2009 at 1:22 AM, reflexactions <[email protected]>wrote:

>
>
> Well depends on what you call 'RGB Format'.....
>
> If you mean you have 3 seperate string values between 0-255, then no it
> doesn't do that, but that is a really trivial one line function to write
> (convert to int and shift and add) and I don't find it strange at all that
> flex doesn't have that built in as I think it would be more normal to hold
> such values externally as hex strings rather than RGB strings.
>
> On the other hand if you mean you have a 24Bit number then that doesnt need
> any real conversion does it.
>
> FYI normally you declare color variables as uint in flex, you can also use
> Number but don't use int, as althougth it can theoretically hold a 24Bit
> value flex gets upset with the signed bit.
>
>
> --- In [email protected] <flexcoders%40yahoogroups.com>,
> "turbo_vb" <timh...@...> wrote:
> >
> > Yeah, that's the one I was thinking of; not RGB to hex though. I claim
> temporary brain death. :)
> >
> > -TH
>
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>,
> "reflexactions" <reflexactions@> wrote:
> > >
> > >
> > > StyleManager.getColorName(...)
> > >
> > > Does what you ask for below.
> > >
> > > --- In [email protected] <flexcoders%40yahoogroups.com>,
> "turbo_vb" <TimHoff@> wrote:
> > > >
> > > > Never mind, I'm just way off-base on this one.
> > > >
> > > > -TH
> > > >
> > > > --- In [email protected] <flexcoders%40yahoogroups.com>,
> "turbo_vb" <TimHoff@> wrote:
> > > > >
> > > > > Isn't there a utility that converts CSS strings like "#ffffff" to
> 0xffffff? Or "white" to 0xfffff?
> > > > >
> > > > > -TH
> > > > >
> > > > > --- In [email protected] <flexcoders%40yahoogroups.com>,
> Alex Harui <aharui@> wrote:
> > > > > >
> > > > > >
> > > > > > I have to admit I'm confused by the question. What is the type of
> the variable holding the RGB value? If it is a uint, the toString(16) should
> be the hex representation.
> > > > > >
> > > > > >
> > > > > > Alex Harui
> > > > > > Flex SDK Developer
> > > > > > Adobe Systems Inc.<http://www.adobe.com/>
> > > > > > Blog: http://blogs.adobe.com/aharui
> > > > > >
> > > > > > From: [email protected] 
> > > > > > <flexcoders%40yahoogroups.com>[mailto:
> [email protected] <flexcoders%40yahoogroups.com>] On Behalf Of
> Chet Haase
> > > > > > Sent: Tuesday, September 29, 2009 4:35 PM
> > > > > > To: [email protected] <flexcoders%40yahoogroups.com>
> > > > > > Subject: RE: [flexcoders] Re: Converting RGB to Hex color
> > > > > >
> > > > > >
> > > > > >
> > > > > > Nope: HSBColor is a utility class for dealing with colors
> represented in the HSB (Hue, Saturation, and Balance) color space. It will
> help you convert between RGB and HSB colors, but will not help you with RGB
> to hex string conversions.
> > > > > >
> > > > > > Chet.
> > > > > >
> > > > > >
> > > > > > From: [email protected] 
> > > > > > <flexcoders%40yahoogroups.com>[mailto:
> [email protected] <flexcoders%40yahoogroups.com>] On Behalf Of
> turbo_vb
> > > > > > Sent: Tuesday, September 29, 2009 1:35 PM
> > > > > > To: [email protected] <flexcoders%40yahoogroups.com>
> > > > > > Subject: [flexcoders] Re: Converting RGB to Hex color
> > > > > >
> > > > > >
> > > > > >
> > > > > > There's a utility in the sdk to convert rgb string to uint. For
> Flex4 it's mx.utils.HSBColor.
> > > > > >
> > > > > > -TH
> > > > > >
> > > > > > --- In [email protected] <flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com <flexcoders%2540yahoogroups.com>>,
> Greg Hess <flexeffect@> wrote:
> > > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I am trying to externalize our effect styles to css. However,
> when I
> > > > > > > read in the color values getStyle() they come in RGB format and
> > > > > > > GlowFilter needs Hex. I have found lots of posts of people
> writing
> > > > > > > rgbToHex conversion function but I find it strange that this is
> not
> > > > > > > available in the Flex SDK.
> > > > > > >
> > > > > > > What is the best way to do such conversions.
> > > > > > >
> > > > > > > Any help much appreciated,
> > > > > > >
> > > > > > > Greg
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>  
>

Reply via email to