|
static | colourPalette ($name=null) |
|
static | rgb ($r, $g, $b, $zero_to_one_range=true) |
|
static | cmyk ($c, $m, $y, $k) |
|
static | hsv ($h, $s, $v) |
|
static | cmykToRgb ($input) |
|
static | rgbToCmyk ($input) |
|
static | cmykCorrect (&$input) |
|
static | rgbInvert ($i) |
|
static | rgbToHtml ($input) |
|
static | intToHtml ($input) |
|
static | intToRgb ($input, $zero_to_one_range=true) |
|
static | htmlToHex ($input) |
|
static | htmlToRgb ($input, $zero_to_one_range=true) |
|
static | htmlToInt ($input) |
|
static | rgbToInt ($input) |
|
static | rgbToHsv ($input) |
|
static | hsvToRgb ($input) |
|
static | htmlToHsv ($input) |
|
static | hsvToHtml ($input) |
|
static | contrastingShade ($input) |
|
static | twiceAsLight ($input) |
|
static | twiceAsDark ($input) |
|
static | adjustBrightness ($input, $amount) |
|
static | adjustContrast ($input, $amount) |
|
static | mix ($a, $b, $ratio=0.5) |
|
static | hueRotate ($input, $degrees) |
|
static | adjustSaturate ($input, $amount) |
|
static | adjustLightness ($input, $amount) |
|
static | hsvAdjust ($input, $h, $s, $v) |
|
static | hsvDifference ($a, $b) |
|
static | remap ($input_html, $map, $tolerance=0.2) |
|
Definition at line 29 of file colour.inc.
static adjustBrightness |
( |
|
$input, |
|
|
|
$amount |
|
) |
| |
|
static |
Adjust brightness on a colour, takes values between -1 and 1
- Parameters
-
string | $input | hex string or html colour name |
float | $amount | the amount of brightness (-1 to 1) |
- Returns
- string public
Definition at line 732 of file colour.inc.
static adjustContrast |
( |
|
$input, |
|
|
|
$amount |
|
) |
| |
|
static |
Adjust contrast on a colour, takes values between -1 and 1
- Parameters
-
string | $input | hex string or html colour name |
float | $amount | the amount of brightness (-1 to 1) |
- Returns
- string public
Definition at line 759 of file colour.inc.
static adjustLightness |
( |
|
$input, |
|
|
|
$amount |
|
) |
| |
|
static |
Adjusts the 'lightness' or value of a colour
- Parameters
-
string | $input | hex string or html colour name |
float | $amount | |
- Returns
- string public
Definition at line 845 of file colour.inc.
static adjustSaturate |
( |
|
$input, |
|
|
|
$amount |
|
) |
| |
|
static |
Adjusts the 'colourfulness' or how non-grey a colour is
- Parameters
-
string | $input | hex string or html colour name |
float | $amount | -1 to 1 (-1 = grey) |
- Returns
- string public
Definition at line 829 of file colour.inc.
static cmyk |
( |
|
$c, |
|
|
|
$m, |
|
|
|
$y, |
|
|
|
$k |
|
) |
| |
|
static |
Create a CMYK colour
- Parameters
-
int | $c | Cyan |
int | $m | Magenta |
int | $y | Yellow |
int | $k | blacK |
- Returns
- Array() public
Definition at line 237 of file colour.inc.
static cmykCorrect |
( |
& |
$input | ) |
|
|
static |
CMYK Colour corrector
- Parameters
-
- Returns
- Array() public
Definition at line 357 of file colour.inc.
static cmykToRgb |
( |
|
$input | ) |
|
|
static |
Converts CMYK to RGB - simple dodgy version
- Parameters
-
- Returns
- Array() public
Definition at line 278 of file colour.inc.
static colourPalette |
( |
|
$name = null | ) |
|
|
static |
Returns a colour palette with colour names to hex colours or a specific hex colour for the passed name
- Parameters
-
string | $name | a specific name to find in the palette |
- Returns
- mixed Array() or string if a specific name is passed public
Definition at line 40 of file colour.inc.
static contrastingShade |
( |
|
$input | ) |
|
|
static |
Takes a colour and returns black or white, depending on which contrasts the most
- Parameters
-
string | $input | hex string or html colour name |
- Returns
- string public
Definition at line 669 of file colour.inc.
static hsv |
( |
|
$h, |
|
|
|
$s, |
|
|
|
$v |
|
) |
| |
|
static |
Create a HSV colour
- Parameters
-
float | $h | Hue |
float | $s | Saturation |
float | $v | Value |
- Returns
- Array() public
Definition at line 262 of file colour.inc.
static hsvAdjust |
( |
|
$input, |
|
|
|
$h, |
|
|
|
$s, |
|
|
|
$v |
|
) |
| |
|
static |
Performs all three HSV operations at once with greater accuracy
- Parameters
-
string | $input | hex string or html colour name |
float | $h | Hue |
float | $s | Saturation |
float | $v | Value |
- Returns
- string public
Definition at line 864 of file colour.inc.
static hsvDifference |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
|
static |
Takes two colours and returns a HSV array of values
- Parameters
-
string | $a | hex string or html colour name |
string | $b | hex string or html colour name |
- Returns
- string public
- See Also
- colour_remap_new_broken
Definition at line 896 of file colour.inc.
static hsvToHtml |
( |
|
$input | ) |
|
|
static |
Converts a HSV colour to a html_colour
- Parameters
-
- Returns
- string public
Definition at line 654 of file colour.inc.
static hsvToRgb |
( |
|
$input | ) |
|
|
static |
Converts an HSV colour to a RGB colour
- Parameters
-
- Returns
- Array() public
Definition at line 573 of file colour.inc.
static htmlToHex |
( |
|
$input | ) |
|
|
static |
Converts a hex string/colour to a hex string
- Parameters
-
string | $input | hex string or html colour name |
- Returns
- string public
Definition at line 453 of file colour.inc.
static htmlToHsv |
( |
|
$input | ) |
|
|
static |
Converts a html colour to a HSV colour
- Parameters
-
string | $input | hex string or html colour name |
- Returns
- Array() public
Definition at line 639 of file colour.inc.
static htmlToInt |
( |
|
$input | ) |
|
|
static |
Converts a hex string/colour to an integer
- Parameters
-
string | $input | hex string or html colour name |
- Returns
- Array() public
Definition at line 498 of file colour.inc.
static htmlToRgb |
( |
|
$input, |
|
|
|
$zero_to_one_range = true |
|
) |
| |
|
static |
Converts a hex string/colour to a RGB colour
- Parameters
-
string | $input | hex string or html colour name |
bool | $zero_to_one_range | when true value are 0 to 1 range |
- Returns
- Array() public
Definition at line 477 of file colour.inc.
static hueRotate |
( |
|
$input, |
|
|
|
$degrees |
|
) |
| |
|
static |
Rotates a colour around the colour spectrum
- Parameters
-
string | $input | hex string or html colour name |
float | $degrees | |
- Returns
- string public
Definition at line 813 of file colour.inc.
static intToHtml |
( |
|
$input | ) |
|
|
static |
Converts an integer to a html code
- Parameters
-
- Returns
- string public
Definition at line 418 of file colour.inc.
static intToRgb |
( |
|
$input, |
|
|
|
$zero_to_one_range = true |
|
) |
| |
|
static |
Converts an integer to an rgb colour
- Parameters
-
int | $input | Some integer |
bool | $zero_to_one_range | when true value are 0 to 1 range |
- Returns
- Array() public
Definition at line 435 of file colour.inc.
static mix |
( |
|
$a, |
|
|
|
$b, |
|
|
|
$ratio = 0.5 |
|
) |
| |
|
static |
Mixes two colours in the desired ratio
- Parameters
-
string | $a | hex string or html colour name |
string | $b | hex string or html colour name |
float | $ratio | ration between 0 and 1 |
- Returns
- string public
Definition at line 789 of file colour.inc.
static remap |
( |
|
$input_html, |
|
|
|
$map, |
|
|
|
$tolerance = 0.2 |
|
) |
| |
|
static |
Takes a colour and a remap array. Looks for the 'key' colours and replaces them with the 'value' colours Might work nicer in HSV colour space.
- Parameters
-
string | $input_html | hex string or html colour name |
Array | $map | Array('old_colour' => 'new_colour'); |
float | $tolerance | |
- Returns
- string public
Definition at line 927 of file colour.inc.
static rgb |
( |
|
$r, |
|
|
|
$g, |
|
|
|
$b, |
|
|
|
$zero_to_one_range = true |
|
) |
| |
|
static |
Create an RGB colour - either in 0 to 1 range or in 0 to 255 range
- Parameters
-
int | $r | Red |
int | $g | Green |
int | $b | Blue |
bool | $zero_to_one_range | when true value are 0 to 1 range |
- Returns
- Array() public
Definition at line 205 of file colour.inc.
Inverts an RGB value
- Parameters
-
- Returns
- Array() public
Definition at line 387 of file colour.inc.
static rgbToCmyk |
( |
|
$input | ) |
|
|
static |
Converts RGB to CMYK - simple dodgy version
- Parameters
-
- Returns
- Array() public
Definition at line 315 of file colour.inc.
static rgbToHsv |
( |
|
$input | ) |
|
|
static |
Converts an RGB colour to a HSV colour (Hue/Saturation/Value) r,g,b values are from 0 to 1 h = [0,360], s = [0,1], v = [0,1] if s == 0, then h = -1 (undefined) h is cyclic
- Parameters
-
Array | $input | RBG colour, with values from 0 to 1 |
- Returns
- Array() public
Definition at line 532 of file colour.inc.
static rgbToHtml |
( |
|
$input | ) |
|
|
static |
Converts an RGB colour to a hex string for html colours
- Parameters
-
- Returns
- string public
Definition at line 403 of file colour.inc.
static rgbToInt |
( |
|
$input | ) |
|
|
static |
Converts a rbg colour to an integer
- Parameters
-
- Returns
- Array() public
Definition at line 513 of file colour.inc.
static twiceAsDark |
( |
|
$input | ) |
|
|
static |
Takes a colour and returns a colour twice at dark (half-way to black)
- Parameters
-
string | $input | hex string or html colour name |
- Returns
- string public
Definition at line 711 of file colour.inc.
static twiceAsLight |
( |
|
$input | ) |
|
|
static |
Takes a colour and returns a colour twice at light (half-way to white)
- Parameters
-
string | $input | hex string or html colour name |
- Returns
- string public
Definition at line 692 of file colour.inc.
The documentation for this class was generated from the following file:
- /Users/webmaster/Desktop/squiz_matrix/fudge/colour/colour.inc