Optionalcolor: ColorInputthe color as one of the valid color input format.
Optionalopts: ConstructorOptionsStatichexkey: hex value value: string name ex. hexnames["f00"] --> "red"
Staticnameskey: 'real' color name value: hex value ex. names["red"] --> "f00"
Gets an analogous color scheme based off of the current color.
Optionalresults: numberThe amount of results to return. Default value: 6.
Optionalslices: numberThe amount to slice the input color by. Default value: 30.
Brighten the color a given amount.
Optionalamount: numberThe amount to brighten by. The valid range is 0 to 100. Default value: 10.
Gets a new instance with the current color
Gets the complement of the current color
Darken the color a given amount. Providing 100 will always return black.
Optionalamount: numberThe amount to darken by. The valid range is 0 to 100. Default value: 10.
Desaturate the color a given amount. Providing 100 will is the same as calling greyscale.
Optionalamount: numberThe amount to desaturate by. The valid range is 0 to 100. Default value: 10.
Returns the alpha value of the color
Returns the perceived brightness of the color, from 0-255.
Returns the format used to create the tinycolor instance.
Returns the perceived luminance of a color, from 0-1.
Returns the input passed into the constructer used to create the tinycolor instance.
Completely desaturates a color into greyscale. Same as calling desaturate(100).
Return an indication whether the color's perceived brightness is dark.
Return an indication whether the color's perceived brightness is light.
Return an indication whether the color was successfully parsed.
Lighten the color a given amount. Providing 100 will always return white.
Optionalamount: numberThe amount to lighten by. The valid range is 0 to 100. Default value: 10.
Gets a monochromatic color scheme based off of the current color.
Optionalresults: numberThe amount of results to return. Default value: 6.
Saturate the color a given amount.
Optionalamount: numberThe amount to saturate by. The valid range is 0 to 100. Default value: 10.
Sets the alpha value on the current color.
The new alpha value. The accepted range is 0-1.
Spin the hue a given amount. Calling with 0, 360, or -360 will do nothing.
The amount to spin by. The valid range is -360 to 360.
Returns the color represented as a Microsoft filter for use in old versions of IE.
Returns the hex value of the color.
Returns the hex 8 value of the color.
Returns the hex 8 value of the color -with a # appened.
Returns the hex value of the color -with a # appened.
Returns the object as a HSLA object.
Returns the hsla values interpolated into a string with the following format: "hsla(xxx, xxx, xxx, xx)".
Returns the object as a HSVA object.
Returns the hsva values interpolated into a string with the following format: "hsva(xxx, xxx, xxx, xx)".
The 'real' name of the color -if there is one.
Returns the object as a RGBA object.
Returns the RGBA relative values interpolated into a string with the following format: "RGBA(xxx, xxx, xxx, xx)".
Returns the object as a RGBA object.
Returns the RGBA values interpolated into a string with the following format: "RGBA(xxx, xxx, xxx, xx)".
String representation of the color.
Optionalformat: The format to be used when displaying the string representation. The accepted values are: "rgb", "prgb", "hex6", "hex3", "hex8", "name", "hsl", "hsv".
StaticequalsCompares two colors. Each colors can be any color inputs.
Optionalcolor1: ColorInputOptionalcolor2: ColorInputStaticfromCreate a tinycolor instance based off the relative values. Works with any color formats
Optionalratio: ColorInputWithoutInstancethe relative color/hue values to apply to the new instance.
StaticisEnsure that foreground and background color combinations meet WCAG2 guidelines.
the fore color wanted.
the back color wanted.
Optionalwcag2: WCAG2OptionsWCAG option. If the entire object is absent, function use the default of {level:"AA",size:"small"}.
StaticmixOptionalamount: numberStaticmostGiven a base color and a list of possible foreground or background colors for that base, returns the most readable color. Optionally returns Black or White if the most readable color is unreadable.
the base color.
array of colors to pick the most readable one from.
Optionalargs: MostReadableArgsand object with extra arguments
StaticrandomReturns a random color
StaticreadabilityCompares the two colors and returns the constrast between two colors as a number.
the first color to be used in the comparison.
the second color to be used in the comparison.
Create a tinycolor instance of the color named.