© Efflare Systems
website : e-mail

index | examples | api | language
Color
Represents RGBA color. Red Green Blue Alpha. Each component has values from 0 to 255. Alpha represents transparency, for which ImageFlare has extensive support. Alpha of 0 is completely transparent.

Constructors
Color( )
» defaults to opaque black

Color( r:number, g:number, b:number, alpha:number=255 )
» red, green, blue and alpha

Color( name:string, alpha:number=255 )
» one of the 455 netscape colors

Color( rgb:number, alpha:number=255 )
» integer representing RGB, 8 bits each in that order, see hex function, eg. Color( hex('FF0000') )

Properties
alpha
» get and set alpha channel

red
» get and set colors red component

green
» get and set colors green component

blue
» get and set colors blue component

name
» get and set the color by name, ( SEE : Web Colors By Name )

hex
» get and set the color by 6 character hex string representing RGB, 8 bits each in that order, the same as html

hue
» get and set hue, 0.0 to 1.0

saturation
» get and set saturation, 0.0 to 1.0

brightness
» get and set brightness, 0.0 to 1.0

Methods
invert
» inverts rgb components

invertalpha
» inverts alpha channel

hsv( hue:number, saturation:number, brightness:number )
» set the color using specified HSV components, preserves alpha, component values are between 0.0 and 1.0

cmyk( cyan:number, magenta:number, yellow:number, black:number=0.0 )
» set the color using specified CMYK components, preserves alpha, component values are between 0.0 and 1.0