holds colors and generates them if there are none left
More...
Public Member Functions |
| __construct () |
| rewind () |
| current () |
| key () |
| next () |
| valid () |
| offsetSet ($offset, $value) |
| offsetGet ($offset) |
| offsetExists ($offset) |
| offsetUnset ($offset) |
| hsv2rgb ($h, $s, $v) |
| converts a hsv color value to rgb [0,1]
|
| rgbbase255 (array $rgb) |
| converts rgb values from 0-1 to 0-255 and rounds it
|
| rgb2html ($r, $g, $b) |
| converts RGB values between 0 and 255 to HTML notation
|
| rgba2html ($r, $g, $b, $a) |
| makes rgba() html notation
|
| random_hue () |
| make a random hue bentween 0 and 360 based on phi and rand
|
| random_color ($hue=null) |
| generates a random color based on preset saturation and value values
|
| many_unique_random_colors ($num, $thresold=10, $thresold2=30) |
| makes a list of unique colors
|
| test_many_colors () |
| displays a table of test colors produced by many_unique_random_colors()
|
| getRGBA ($offset, $a) |
Detailed Description
holds colors and generates them if there are none left
Definition at line 36 of file chart.class.php.
Constructor & Destructor Documentation
Member Function Documentation
converts a hsv color value to rgb [0,1]
- Parameters
-
$h | Hue value between 0 and 360° |
$s | Satuation percent value between 0 and 1 |
$v | Value percent value between 0 and 1 |
- Returns
- array with R, G and B values between 0 and 1
- Exceptions
-
exception | when the HSV values are not correct |
Definition at line 131 of file chart.class.php.
many_unique_random_colors |
( |
|
$num, |
|
|
|
$thresold = 10 , |
|
|
|
$thresold2 = 30 |
|
) |
| |
makes a list of unique colors
- Parameters
-
int | $num | how many colors should we try to generate |
int | $thresold | acceptable margin where a generated Hue value (between 0 and 360) can be set as unique. The lower, the more colors can be retrieved but the more the colors will be similar |
int | $thresold2 | acceptable margin where a generated Hue value (between 0 and 360) can be alike his predecessor |
- Returns
- array of hsv color arrays, depending on the restrictions set not even at all the requested size
Definition at line 255 of file chart.class.php.
offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
random_color |
( |
|
$hue = null | ) |
|
generates a random color based on preset saturation and value values
- Parameters
-
int | $hue | optional if not given a random hue will be produced |
- Returns
- array of rgb values between 0 and 1
Definition at line 234 of file chart.class.php.
make a random hue bentween 0 and 360 based on phi and rand
- Returns
- int somewhere bentween 0 and 360
Definition at line 221 of file chart.class.php.
converts RGB values between 0 and 255 to HTML notation
- Parameters
-
$r | Red value between 0 and 255 |
$g | Green value between 0 and 255 |
$b | Blue value between 0 and 255 |
- Returns
- string html notation with leading #
Definition at line 196 of file chart.class.php.
rgba2html |
( |
|
$r, |
|
|
|
$g, |
|
|
|
$b, |
|
|
|
$a |
|
) |
| |
makes rgba() html notation
- Parameters
-
$r | Red value between 0 and 255 |
$g | Green value between 0 and 255 |
$b | Blue value between 0 and 255 |
$a | Transparency value between 0 and 1 |
- Returns
- string html notation with leading #
Definition at line 212 of file chart.class.php.
converts rgb values from 0-1 to 0-255 and rounds it
- Parameters
-
array | $rgb | an array with values for RGB all between 0 and 1 |
- Returns
- array with RGB values between 0 and 255 rounded
- Exceptions
-
exception | when the array has not exactly 3 values or one of the values is not between 0 and 1 |
Definition at line 173 of file chart.class.php.
Field Documentation
The documentation for this class was generated from the following file: