S2:Color

From No LJ Ads Wiki

Jump to: navigation, search

Represents a color.

[edit] Members

string as_string HTML hex encoded: #rrggbb
int b Blue value, 0-255. (Read-only)
int g Green value, 0-255. (Read-only)
int r Red value, 0-255. (Read-only)

[edit] Methods

Color(string s) : Color Constructor for color class. Lets you make a Color object from a string of form #rrggbb
average(Color other) : Color Returns color averaged with other color.
blend(Color other, int value) : Color Returns color blended with other color by percentage value (int between 0 and 100).
blue() : int Get the blue value. (0-255)
blue(int b) : void Set the blue value. (0-255)
clone() : Color Returns identical color.
darker() : Color Returns a new color with lightness decreased by 30.
darker(int amt) : Color Returns a new color with lightness decreased by 30.
green() : int Get the green value. (0-255)
green(int b) : void Set the green value. (0-255)
hue() : int Get the hue value. (0-255)
hue(int h) : void Set the hue value. (0-255)
inverse() : Color Returns inverse of color.
lighter() : Color Returns a new color with lightness increased by 30.
lighter(int amt) : Color Returns a new color with lightness increased by amount given
lightness() : int Get the lightness value. (0-255)
lightness(int v) : void Set the lightness value. (0-255)
red() : int Get the red value. (0-255)
red(int b) : void Set the red value. (0-255)
saturation() : int Get the saturation value. (0-255)
saturation(int s) : void Set the saturation value. (0-255)
set_hsl(int h, int s, int v) : void Set the HSL value for a color class.