Clear Up
SharpKit Reference

Color Class

Represents an RGB color and provides helper functions get color components in HSL color space.

Namespace: Ext.draw

Base Types

Constructors

Methods

Name Description
fromHSL(JsNumber, JsNumber, JsNumber) Create a new color based on the specified HSL values. Note: This method is both static and instance.
fromString(JsString) Parse the string and create a new color. Supported formats: '#rrggbb', '#rgb', and 'rgb(r,g,b)'. If the string is not recognized, an undefined will be returned instead. Note: This method is both static and instance.
getBlue() Get the blue component of the color, in the range 0..255.
getDarker(JsNumber) Return a new color that is darker than this color.
getGrayscale() Returns the gray value (0 to 255) of the color. The gray value is calculated using the formula r0.3 + g0.59 + b*0.11.
getGreen() Get the green component of the color, in the range 0..255.
getHSL() Get the equivalent HSL components of the color.
getLighter(JsNumber) Return a new color that is lighter than this color.
getRed() Get the red component of the color, in the range 0..255.
getRGB() Get the RGB values.
toHex(object) Convert a color to hexadecimal format. Note: This method is both static and instance.
toString() Return the color in the hex format, i.e. '#rrggbb'.

Fields

Name Description
lightnessFactor The default factor to compute the lighter or darker color. Defaults to 0.2. Defaults to: 0.2
© Copyright 2005-2011 SharpKit. All rights reserved.