Свойство | Тип | Описание | |
---|---|---|---|
$alpha | integer | float | ||
$blue | integer | double | ||
$brightness | array | ||
$chroma | integer | float | ||
$color | string | array | The color as defined in the input | |
$green | integer | double | ||
$hex | string | The HEX value of the color. | |
$hue | integer | float | ||
$instances | array | Each instance is stored as an object in this array. Allows easier access & performance. | |
$lightness | integer | float | ||
$luminance | integer | float | ||
$mode | string | The mode of this color (hex/rgb/rgba etc.). | |
$red | integer | double | ||
$saturation | integer | float | ||
$word_colors | array | Example: white = #ffffff |
Метод | Описание | |
---|---|---|
getNew ( $property = '', $value = '' ) : ariColor | null | Allows us to get a new instance by modifying a property of the existing one. | |
get_mode ( string $color ) : string | null | Figure out what mode we're using. | |
newColor ( $color, $mode = 'auto' ) : ariColor | Gets an instance for this color. | |
toCSS ( $mode = 'hex' ) : string | Returns a CSS-formatted value for colors. |
Метод | Описание | |
---|---|---|
__construct ( $color = '', $mode = 'auto' ) | The class constructor | |
dexhex_double_digit ( $value ) : string | Convert a decimal value to hex and make sure it's 2 characters | |
from_hex ( ) : void | Starts with a HEX color and calculates all other properties. | |
from_hsl ( ) : void | Starts with an HSL color and calculates all other properties. | |
from_hsl_array ( ) | Calculates the red, green, blue values of an HSL color | |
from_hsla ( ) : void | Starts with an HSLA color and calculates all other properties. | |
from_rgb ( ) : void | Starts with an RGB color and calculates all other properties. | |
from_rgba ( ) : void | Starts with an RGBA color and calculates all other properties. | |
get_word_colors ( ) : array | Gets an array of all the wordcolors | |
rgb_to_hex ( $red, $green, $blue ) : string | Generates the HEX value of a color given values for $red, $green, $blue | |
set_brightness ( ) | Sets the brightness of a color based on the values of red, green, blue | |
set_hsl ( ) | Sets the HSL values of a color based on the values of red, green, blue | |
set_luminance ( ) | Sets the luminance of a color (range:0-255) based on the values of red, green, blue |
public static newColor ( $color, $mode = 'auto' ) : ariColor | ||
$color | string|array | |
$mode | string | |
Результат | ariColor | (object) |
public static array $instances | ||
Результат | array |
public string $mode | ||
Результат | string |