APP_PHPColors
A color utility that helps manipulate HEX colors
Package
Description Description
Methods Methods
- __construct — Instantiates the class with a HEX value
- __get
- __set
- __toString — Converts object into its string representation
- _checkHex — You need to check if you were given a good hex string
- _checkRgb — You need to check if you were given a good rgba string or array.
- _darken — Darkens a given HSL array
- _huetorgb — Given a Hue, returns corresponding RGB value
- _lighten — Lightens a given HSL array
- _mix — Mix 2 rgb colors and return an rgb color
- complementary — Returns the complimentary color
- darken — Given a HEX value, returns a darker color. If no desired amount provided, then the color halfway between given HEX and black will be returned.
- foreground — Checks the lightness of given color, and if it passes the `$threshold` of lightness, it returns the darker color. Otherwise, it returns the lighter color.
- getCssGradient — Returns the cross browser CSS3 gradient
- getHex — Returns your original color
- getHsl — Returns your color's HSL array
- getRgb — Returns your color's RGB array
- hexToHsl — Given a HEX string returns a HSL array equivalent.
- hexToRgb — Given a HEX string returns a RGB array equivalent.
- hslToHex — Given a HSL associative array returns the equivalent HEX string
- isDark — Returns whether or not a given color is considered 'dark'
- isLight — Returns whether or not given color is considered 'light'
- lighten — Given a HEX value, returns a lighter color. If no desired amount provided, then the color halfway between given HEX and white will be returned.
- makeGradient — Creates an array with two shades that can be used to make a gradient
- mix — Given a HEX value, returns a mixed color. If no desired amount provided, then the color mixed by this ratio
- rgbToHex — Given an RGB associative array returns the equivalent HEX string
- smart_scale — Scales a color to be lighter if it's light, or darker if it's dark.