$color
$color : int
Color utility and conversion
Represents a color value, and converts between RGB/HSV/XYZ/Lab/HSL
Example: $color = new Jetpack_Color(0xFFFFFF);
fromHex(string $hexValue) : \Jetpack_Color
Init color from hex value
string | $hexValue |
fromRgbInt(int $red, int $green, int $blue) : \Jetpack_Color
Init color from integer RGB values
int | $red | |
int | $green | |
int | $blue |
fromRgbHex(string $red, string $green, string $blue) : \Jetpack_Color
Init color from hex RGB values
string | $red | |
string | $green | |
string | $blue |
fromInt(int $intValue) : \Jetpack_Color
Init color from integer value
int | $intValue |
getDistanceRgbFrom(\Jetpack_Color $color) : int
Get the distance between this color and the given color
\Jetpack_Color | $color |
getDistanceLabFrom(\Jetpack_Color $color) : float
Get distance from the given color using the Delta E method
\Jetpack_Color | $color |
getDistanceLuminosityFrom(\Jetpack_Color $color) : float
Get distance between colors using luminance.
Should be more than 5 for readable contrast
\Jetpack_Color | $color | Another color |
getReadableContrastingColor(object $bg_color, integer $min_contrast) : object
Gets a readable contrasting color. $this is assumed to be the text and $color the background color.
object | $bg_color | A Color object that will be compared against $this |
integer | $min_contrast | The minimum contrast to achieve, if possible. |
A Color object, an increased contrast $this compared against $bg_color