\begin{quote}
Java\+Script library for immutable color conversion and manipulation with support for CSS color strings. \end{quote}

\begin{DoxyCode}{0}
\DoxyCodeLine{var color = Color('\#7743CE').alpha(0.5).lighten(0.5);}
\DoxyCodeLine{console.log(color.hsl().string());  // 'hsla(262, 59\%, 81\%, 0.5)'}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(color.cmyk().round().array());  // [ 16, 25, 0, 8, 0.5 ]}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(color.ansi256().object());  // \{ ansi256: 183, alpha: 0.5 \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5788}{}\doxysection{Install}\label{md_sfcode_node_modules_color_README_autotoc_md5788}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install color }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5789}{}\doxysection{Usage}\label{md_sfcode_node_modules_color_README_autotoc_md5789}

\begin{DoxyCode}{0}
\DoxyCodeLine{var Color = require('color'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5790}{}\doxysubsection{Constructors}\label{md_sfcode_node_modules_color_README_autotoc_md5790}

\begin{DoxyCode}{0}
\DoxyCodeLine{var color = Color('rgb(255, 255, 255)')}
\DoxyCodeLine{var color = Color(\{r: 255, g: 255, b: 255\})}
\DoxyCodeLine{var color = Color.rgb(255, 255, 255)}
\DoxyCodeLine{var color = Color.rgb([255, 255, 255]) }

\end{DoxyCode}


Set the values for individual channels with {\ttfamily alpha}, {\ttfamily red}, {\ttfamily green}, {\ttfamily blue}, {\ttfamily hue}, {\ttfamily saturationl} (hsl), {\ttfamily saturationv} (hsv), {\ttfamily lightness}, {\ttfamily whiteness}, {\ttfamily blackness}, {\ttfamily cyan}, {\ttfamily magenta}, {\ttfamily yellow}, {\ttfamily black}

String constructors are handled by \href{https://www.npmjs.com/package/color-string}{\texttt{ color-\/string}}\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5791}{}\doxysubsection{Getters}\label{md_sfcode_node_modules_color_README_autotoc_md5791}

\begin{DoxyCode}{0}
\DoxyCodeLine{color.hsl(); }

\end{DoxyCode}
 Convert a color to a different space ({\ttfamily hsl()}, {\ttfamily cmyk()}, etc.).


\begin{DoxyCode}{0}
\DoxyCodeLine{color.object(); // \{r: 255, g: 255, b: 255\} }

\end{DoxyCode}
 Get a hash of the color value. Reflects the color\textquotesingle{}s current model (see above).


\begin{DoxyCode}{0}
\DoxyCodeLine{color.rgb().array()  // [255, 255, 255] }

\end{DoxyCode}
 Get an array of the values with {\ttfamily array()}. Reflects the color\textquotesingle{}s current model (see above).


\begin{DoxyCode}{0}
\DoxyCodeLine{color.rgbNumber() // 16777215 (0xffffff) }

\end{DoxyCode}
 Get the rgb number value.


\begin{DoxyCode}{0}
\DoxyCodeLine{color.hex() // \#ffffff }

\end{DoxyCode}
 Get the hex value.


\begin{DoxyCode}{0}
\DoxyCodeLine{color.red()       // 255 }

\end{DoxyCode}
 Get the value for an individual channel.\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5792}{}\doxysubsection{CSS Strings}\label{md_sfcode_node_modules_color_README_autotoc_md5792}

\begin{DoxyCode}{0}
\DoxyCodeLine{color.hsl().string()  // 'hsl(320, 50\%, 100\%)' }

\end{DoxyCode}


Calling {\ttfamily .string()} with a number rounds the numbers to that decimal place. It defaults to 1.\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5793}{}\doxysubsection{Luminosity}\label{md_sfcode_node_modules_color_README_autotoc_md5793}

\begin{DoxyCode}{0}
\DoxyCodeLine{color.luminosity();  // 0.412 }

\end{DoxyCode}
 The \href{http://www.w3.org/TR/WCAG20/\#relativeluminancedef}{\texttt{ WCAG luminosity}} of the color. 0 is black, 1 is white.


\begin{DoxyCode}{0}
\DoxyCodeLine{color.contrast(Color("{}blue"{}))  // 12 }

\end{DoxyCode}
 The \href{http://www.w3.org/TR/WCAG20/\#contrast-ratiodef}{\texttt{ WCAG contrast ratio}} to another color, from 1 (same color) to 21 (contrast b/w white and black).


\begin{DoxyCode}{0}
\DoxyCodeLine{color.isLight();  // true}
\DoxyCodeLine{color.isDark();   // false }

\end{DoxyCode}
 Get whether the color is \char`\"{}light\char`\"{} or \char`\"{}dark\char`\"{}, useful for deciding text color.\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5794}{}\doxysubsection{Manipulation}\label{md_sfcode_node_modules_color_README_autotoc_md5794}

\begin{DoxyCode}{0}
\DoxyCodeLine{color.negate()         // rgb(0, 100, 255) -\/> rgb(255, 155, 0)}
\DoxyCodeLine{}
\DoxyCodeLine{color.lighten(0.5)     // hsl(100, 50\%, 50\%) -\/> hsl(100, 50\%, 75\%)}
\DoxyCodeLine{color.lighten(0.5)     // hsl(100, 50\%, 0)   -\/> hsl(100, 50\%, 0)}
\DoxyCodeLine{color.darken(0.5)      // hsl(100, 50\%, 50\%) -\/> hsl(100, 50\%, 25\%)}
\DoxyCodeLine{color.darken(0.5)      // hsl(100, 50\%, 0)   -\/> hsl(100, 50\%, 0)}
\DoxyCodeLine{}
\DoxyCodeLine{color.lightness(50)    // hsl(100, 50\%, 10\%) -\/> hsl(100, 50\%, 50\%)}
\DoxyCodeLine{}
\DoxyCodeLine{color.saturate(0.5)    // hsl(100, 50\%, 50\%) -\/> hsl(100, 75\%, 50\%)}
\DoxyCodeLine{color.desaturate(0.5)  // hsl(100, 50\%, 50\%) -\/> hsl(100, 25\%, 50\%)}
\DoxyCodeLine{color.grayscale()      // \#5CBF54 -\/> \#969696}
\DoxyCodeLine{}
\DoxyCodeLine{color.whiten(0.5)      // hwb(100, 50\%, 50\%) -\/> hwb(100, 75\%, 50\%)}
\DoxyCodeLine{color.blacken(0.5)     // hwb(100, 50\%, 50\%) -\/> hwb(100, 50\%, 75\%)}
\DoxyCodeLine{}
\DoxyCodeLine{color.fade(0.5)     // rgba(10, 10, 10, 0.8) -\/> rgba(10, 10, 10, 0.4)}
\DoxyCodeLine{color.opaquer(0.5)     // rgba(10, 10, 10, 0.8) -\/> rgba(10, 10, 10, 1.0)}
\DoxyCodeLine{}
\DoxyCodeLine{color.rotate(180)      // hsl(60, 20\%, 20\%) -\/> hsl(240, 20\%, 20\%)}
\DoxyCodeLine{color.rotate(-\/90)      // hsl(60, 20\%, 20\%) -\/> hsl(330, 20\%, 20\%)}
\DoxyCodeLine{}
\DoxyCodeLine{color.mix(Color("{}yellow"{}))        // cyan -\/> rgb(128, 255, 128)}
\DoxyCodeLine{color.mix(Color("{}yellow"{}), 0.3)   // cyan -\/> rgb(77, 255, 179)}
\DoxyCodeLine{}
\DoxyCodeLine{// chaining}
\DoxyCodeLine{color.green(100).grayscale().lighten(0.6) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_color_README_autotoc_md5795}{}\doxysection{Propers}\label{md_sfcode_node_modules_color_README_autotoc_md5795}
The API was inspired by \href{https://github.com/brehaut/color-js}{\texttt{ color-\/js}}. Manipulation functions by CSS tools like Sass, LESS, and Stylus. 