| Package | de.popforge.imageprocessing.geom |
| Class | public final class Color |
| Property | Defined by | ||
|---|---|---|---|
| b : Number The blue value of the color from 0 to 255.
| Color | ||
| g : Number The green value of the color from 0 to 255.
| Color | ||
| r : Number The red value of the color from 0 to 255.
| Color | ||
| Method | Defined by | ||
|---|---|---|---|
|
Color(red:Number, green:Number, blue:Number)
Creates a Color object with the specific RGB values.
| Color | ||
|
Adds a color vector to the current color vector.
| Color | ||
|
addBrightness(value:Number):void
Adds a value to the color vector.
| Color | ||
|
clamp():void
Clamps the color vector between 0 and 255.
| Color | ||
|
[static]
Creates and returns a new Color object from given CMY values.
| Color | ||
|
[static]
Creates and returns a new Color object from given HSL values.
| Color | ||
|
[static]
Creates and returns a new Color object from given HSV values.
| Color | ||
|
[static]
Creates and returns a new Color object from given integer.
| Color | ||
|
[static]
Creates and returns a new Color object from given RGB values.
| Color | ||
|
getBrightness():Number
Calculates the length of the color vector.
| Color | ||
|
getLuminance():int
Calculates the luminance of a color.
| Color | ||
|
getMultiplied(value:Number):Color
| Color | ||
|
getSaturation():int
Calculates the saturation of a color.
| Color | ||
|
invert():void
Inverts the color vector.
| Color | ||
|
multiply(value:Number):void
Multiplies the color vector.
| Color | ||
|
normalize():void
Normalizes the color vector.
| Color | ||
|
Substracts a color vector from the current color vector.
| Color | ||
|
toInt():int
Creates the integer representation of the color.
| Color | ||
|
toString():String
Builds and returns a string that lists the values of the Color object.
| Color | ||
| b | property |
public var b:NumberThe blue value of the color from 0 to 255.
| g | property |
public var g:NumberThe green value of the color from 0 to 255.
| r | property |
public var r:NumberThe red value of the color from 0 to 255.
| Color | () | constructor |
public function Color(red:Number, green:Number, blue:Number)Creates a Color object with the specific RGB values. The vector will be clamped automatically.
Parametersred:Number — Red value from 0 to 255.
|
|
green:Number — Green value from 0 to 255.
|
|
blue:Number — Blue value from 0 to 255.
|
| add | () | method |
public function add(color:Color):voidAdds a color vector to the current color vector. The vector will be clamped automatically.
Parameterscolor:Color — The color you want to add.
|
| addBrightness | () | method |
public function addBrightness(value:Number):voidAdds a value to the color vector. The vector will be clamped automatically.
Parametersvalue:Number — The value you want to add.
|
| clamp | () | method |
public function clamp():voidClamps the color vector between 0 and 255.
| fromCMY | () | method |
public static function fromCMY(c:Number, m:Number, y:Number):ColorCreates and returns a new Color object from given CMY values.
Parametersc:Number — Cyan value from 0 to 1.
|
|
m:Number — Magenta value from 0 to 1.
|
|
y:Number — Yellow value form 0 to 1.
|
Color —
A Color object based on the given values.
|
| fromHSL | () | method |
public static function fromHSL(h:Number, s:Number, l:Number):ColorCreates and returns a new Color object from given HSL values. This function is based on the link below.
Parametersh:Number — Hue value from 0 to 1.
|
|
s:Number — Saturation value from 0 to 1.
|
|
l:Number — Lightness value form 0 to 1.
|
Color —
A Color object based on the given values.
|
See also
| fromHSV | () | method |
public static function fromHSV(h:Number, s:Number, v:Number):ColorCreates and returns a new Color object from given HSV values. This function is based on the link below.
Parametersh:Number — Hue value from 0 to 1.
|
|
s:Number — Saturation value from 0 to 1.
|
|
v:Number — Value value form 0 to 1.
|
Color —
A Color object based on the given values.
|
See also
| fromInt | () | method |
public static function fromInt(rgb:int):ColorCreates and returns a new Color object from given integer.
Parametersrgb:int — 24-BIT integer in 0xRRGGBB order.
|
Color —
A Color object based on the given values.
|
| fromRGB | () | method |
public static function fromRGB(r:int = 0, g:int = 0, b:int = 0):ColorCreates and returns a new Color object from given RGB values.
Parametersr:int (default = 0) — Red value from 0 to 255.
|
|
g:int (default = 0) — Green value from 0 to 255.
|
|
b:int (default = 0) — Blue value form 0 to 255.
|
Color —
A Color object based on the given values.
|
| getBrightness | () | method |
public function getBrightness():NumberCalculates the length of the color vector.
ReturnsNumber — The length of the color vector.
|
| getLuminance | () | method |
public function getLuminance():intCalculates the luminance of a color.
Returnsint — The luminance value from 0 to 255.
|
| getMultiplied | () | method |
| getSaturation | () | method |
public function getSaturation():intCalculates the saturation of a color.
Returnsint — The saturation value from 0 to 255.
|
| invert | () | method |
public function invert():voidInverts the color vector. The vector will be clamped automatically.
| multiply | () | method |
public function multiply(value:Number):voidMultiplies the color vector. The vector will be clamped automatically.
Parametersvalue:Number — Any value you want to multiply the color with.
|
| normalize | () | method |
public function normalize():voidNormalizes the color vector. The vector will be clamped automatically.
| substract | () | method |
public function substract(color:Color):voidSubstracts a color vector from the current color vector. The vector will be clamped automatically.
Parameterscolor:Color — The color you want to substract.
|
| toInt | () | method |
public function toInt():intCreates the integer representation of the color.
Returnsint — A 24-BIT integer in 0xRRGGBB order.
|
| toString | () | method |
public function toString():StringBuilds and returns a string that lists the values of the Color object.
ReturnsString — A string listing the value of each of the following properties of the Color object: r, g, b
|