\href{https://travis-ci.org/Qix-/color-string}{\texttt{ }}

\begin{quote}
library for parsing and generating CSS color strings. \end{quote}
\hypertarget{md_sfcode_node_modules_color_string_README_autotoc_md5811}{}\doxysection{Install}\label{md_sfcode_node_modules_color_string_README_autotoc_md5811}
With \href{http://npmjs.org/}{\texttt{ npm}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install color-\/string }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_color_string_README_autotoc_md5812}{}\doxysection{Usage}\label{md_sfcode_node_modules_color_string_README_autotoc_md5812}
\hypertarget{md_sfcode_node_modules_color_string_README_autotoc_md5813}{}\doxysubsection{Parsing}\label{md_sfcode_node_modules_color_string_README_autotoc_md5813}

\begin{DoxyCode}{0}
\DoxyCodeLine{colorString.get('\#FFF')                          // \{model: 'rgb', value: [255, 255, 255, 1]\}}
\DoxyCodeLine{colorString.get('\#FFFA')                         // \{model: 'rgb', value: [255, 255, 255, 0.67]\}}
\DoxyCodeLine{colorString.get('\#FFFFFFAA')                     // \{model: 'rgb', value: [255, 255, 255, 0.67]\}}
\DoxyCodeLine{colorString.get('hsl(360, 100\%, 50\%)')           // \{model: 'hsl', value: [0, 100, 50, 1]\}}
\DoxyCodeLine{colorString.get('hwb(60, 3\%, 60\%)')              // \{model: 'hwb', value: [60, 3, 60, 1]\}}
\DoxyCodeLine{}
\DoxyCodeLine{colorString.get.rgb('\#FFF')                      // [255, 255, 255, 1]}
\DoxyCodeLine{colorString.get.rgb('blue')                      // [0, 0, 255, 1]}
\DoxyCodeLine{colorString.get.rgb('rgba(200, 60, 60, 0.3)')    // [200, 60, 60, 0.3]}
\DoxyCodeLine{colorString.get.rgb('rgb(200, 200, 200)')        // [200, 200, 200, 1]}
\DoxyCodeLine{}
\DoxyCodeLine{colorString.get.hsl('hsl(360, 100\%, 50\%)')       // [0, 100, 50, 1]}
\DoxyCodeLine{colorString.get.hsl('hsla(360, 60\%, 50\%, 0.4)')  // [0, 60, 50, 0.4]}
\DoxyCodeLine{}
\DoxyCodeLine{colorString.get.hwb('hwb(60, 3\%, 60\%)')          // [60, 3, 60, 1]}
\DoxyCodeLine{colorString.get.hwb('hwb(60, 3\%, 60\%, 0.6)')     // [60, 3, 60, 0.6]}
\DoxyCodeLine{}
\DoxyCodeLine{colorString.get.rgb('invalid color string')      // null }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_color_string_README_autotoc_md5814}{}\doxysubsection{Generation}\label{md_sfcode_node_modules_color_string_README_autotoc_md5814}

\begin{DoxyCode}{0}
\DoxyCodeLine{colorString.to.hex([255, 255, 255])     // "{}\#FFFFFF"{}}
\DoxyCodeLine{colorString.to.hex([0, 0, 255, 0.4])    // "{}\#0000FF66"{}}
\DoxyCodeLine{colorString.to.hex([0, 0, 255], 0.4)    // "{}\#0000FF66"{}}
\DoxyCodeLine{colorString.to.rgb([255, 255, 255])     // "{}rgb(255, 255, 255)"{}}
\DoxyCodeLine{colorString.to.rgb([0, 0, 255, 0.4])    // "{}rgba(0, 0, 255, 0.4)"{}}
\DoxyCodeLine{colorString.to.rgb([0, 0, 255], 0.4)    // "{}rgba(0, 0, 255, 0.4)"{}}
\DoxyCodeLine{colorString.to.rgb.percent([0, 0, 255]) // "{}rgb(0\%, 0\%, 100\%)"{}}
\DoxyCodeLine{colorString.to.keyword([255, 255, 0])   // "{}yellow"{}}
\DoxyCodeLine{colorString.to.hsl([360, 100, 100])     // "{}hsl(360, 100\%, 100\%)"{}}
\DoxyCodeLine{colorString.to.hwb([50, 3, 15])         // "{}hwb(50, 3\%, 15\%)"{}}
\DoxyCodeLine{}
\DoxyCodeLine{// all functions also support swizzling}
\DoxyCodeLine{colorString.to.rgb(0, [0, 255], 0.4)    // "{}rgba(0, 0, 255, 0.4)"{}}
\DoxyCodeLine{colorString.to.rgb([0, 0], [255], 0.4)  // "{}rgba(0, 0, 255, 0.4)"{}}
\DoxyCodeLine{colorString.to.rgb([0], 0, [255, 0.4])  // "{}rgba(0, 0, 255, 0.4)"{} }

\end{DoxyCode}
 