Color

The Color class provides precomputed palettes and common color names for widgets so they can be presented as a coherent color theme.

The size of the Color class is kept small enough to be used in a preloader.  This class is therefore not integrated with the ColorNameTable class because the combined size would be prohibitive for a preloader.

Summary
ColorThe Color class provides precomputed palettes and common color names for widgets so they can be presented as a coherent color theme.
Common color names
Common color palettes
paletteLightNOTE: Assumption
paletteMediumMedium color palette
paletteBrightBright color palette aka Rainbow
paletteShadowShadow color palette
Color palette iterators
indexCurrent index into the color palettes
nextGet the next medium color in the palette sequence
randomGet a medium color chosen by random from the palette sequence
Color conversion
lightConvert a color value to its light palette variation.
mediumConvert a color value to its medium palette variation.
brightConvert a color value to its bright palette variation.
shadowConvert a color value to its shadow palette variation.
Palette query methods
isLightReturns true if the color value is in the light palette
isMediumReturns true if the color value is in the medium palette
isBrightReturns true if the color value is in the bright palette
isShadowReturns true if the color value is in the shadow palette
isInPaletteReturns true if the color value is in any palette

Common color names

Common color palettes

paletteLight

private static var paletteLight: Array

NOTE: Assumption

IT IS ASSUMED THAT ALL PALETTES CONTAIN THE SAME NUMBER OF COLORS AS THE MEDIUM PALETTE.

/** Light color palette

paletteMedium

private static var paletteMedium: Array

Medium color palette

paletteBright

private static var paletteBright: Array

Bright color palette aka Rainbow

paletteShadow

private static var paletteShadow: Array

Shadow color palette

Color palette iterators

index

private static var index: uint

Current index into the color palettes

next

public static function get next():uint

Get the next medium color in the palette sequence

Returns

A color value

random

public static function get random():uint

Get a medium color chosen by random from the palette sequence

Returns

A color value

Color conversion

light

public static function light(color: uint):uint

Convert a color value to its light palette variation.  If the color value is not a palette value then white is returned.

Parameters

A color value.

Returns

A light color value.

medium

public static function medium(color: uint):uint

Convert a color value to its medium palette variation.  If the color value is not a palette value then medium grey is returned.

Parameters

A color value.

Returns

A medium color value.

bright

public static function bright(color: uint):uint

Convert a color value to its bright palette variation.  If the color value is not a palette value then light grey is returned.

Parameters

A color value.

Returns

A bright color value.

shadow

public static function shadow(color: uint):uint

Convert a color value to its shadow palette variation.  If the color value is not a palette value then dark grey is returned.

Parameters

A color value.

Returns

A shadow color value.

Palette query methods

isLight

public static function isLight(color: uint):Boolean

Returns true if the color value is in the light palette

isMedium

public static function isMedium(color: uint):Boolean

Returns true if the color value is in the medium palette

isBright

public static function isBright(color: uint):Boolean

Returns true if the color value is in the bright palette

isShadow

public static function isShadow(color: uint):Boolean

Returns true if the color value is in the shadow palette

isInPalette

public static function isInPalette(color: uint):Boolean

Returns true if the color value is in any palette

private static var paletteLight: Array
NOTE: Assumption
private static var paletteMedium: Array
Medium color palette
private static var paletteBright: Array
Bright color palette aka Rainbow
private static var paletteShadow: Array
Shadow color palette
private static var index: uint
Current index into the color palettes
public static function get next():uint
Get the next medium color in the palette sequence
public static function get random():uint
Get a medium color chosen by random from the palette sequence
public static function light(color: uint):uint
Convert a color value to its light palette variation.
public static function medium(color: uint):uint
Convert a color value to its medium palette variation.
public static function bright(color: uint):uint
Convert a color value to its bright palette variation.
public static function shadow(color: uint):uint
Convert a color value to its shadow palette variation.
public static function isLight(color: uint):Boolean
Returns true if the color value is in the light palette
public static function isMedium(color: uint):Boolean
Returns true if the color value is in the medium palette
public static function isBright(color: uint):Boolean
Returns true if the color value is in the bright palette
public static function isShadow(color: uint):Boolean
Returns true if the color value is in the shadow palette
public static function isInPalette(color: uint):Boolean
Returns true if the color value is in any palette
Table of color names and values as recognized in IE4+, SVG, etc.
Close