\begin{quote}
Detect whether a terminal supports color \end{quote}
\hypertarget{md_sfcode_node_modules_protractor_node_modules_supports_color_readme_autotoc_md23094}{}\doxysection{Install}\label{md_sfcode_node_modules_protractor_node_modules_supports_color_readme_autotoc_md23094}

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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{var supportsColor = require('supports-\/color');}
\DoxyCodeLine{}
\DoxyCodeLine{if (supportsColor) \{}
\DoxyCodeLine{    console.log('Terminal supports color');}
\DoxyCodeLine{\} }

\end{DoxyCode}


It obeys the {\ttfamily -\/-\/color} and {\ttfamily -\/-\/no-\/color} CLI flags.

For situations where using {\ttfamily -\/-\/color} is not possible, add an environment variable {\ttfamily FORCE\+\_\+\+COLOR} with any value to force color. Trumps {\ttfamily -\/-\/no-\/color}.\hypertarget{md_sfcode_node_modules_protractor_node_modules_supports_color_readme_autotoc_md23096}{}\doxysection{Related}\label{md_sfcode_node_modules_protractor_node_modules_supports_color_readme_autotoc_md23096}

\begin{DoxyItemize}
\item \href{https://github.com/chalk/supports-color-cli}{\texttt{ supports-\/color-\/cli}} -\/ CLI for this module
\item \href{https://github.com/chalk/chalk}{\texttt{ chalk}} -\/ Terminal string styling done right
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_protractor_node_modules_supports_color_readme_autotoc_md23097}{}\doxysection{License}\label{md_sfcode_node_modules_protractor_node_modules_supports_color_readme_autotoc_md23097}
MIT © \href{http://sindresorhus.com}{\texttt{ Sindre Sorhus}} 