Colors are supported by tex4ht
but there are two points:
\color
command isn't supported:
The \Verb!\color{red}! instruction might be problematic since it does
not on its own determine the extent of the text to be colored. As a
result, its effect can cross logical boundaries. That is against the
philosophy of markup languages in general and of XML in particular.
It is possible to implement the \Verb!\color{...}! feature but I'm not
sure it is desirable to do so. I think it is preferable to expect
users to use commands of the form \Verb!\textcolor{red}{...}! for code
fragments.
so it is better to use \textcolor
each color has to be declared for tex4ht
with command in the form:
\Configure{HColor}{colorname}{csscode}
Now back to your code. I think that:
\begin{itemize}
\item[\label={\notefont Note:}]
}{%
is wrong, you are calling \label
command with =
as argument. It should be:
\begin{itemize}
\item[{\notefont Note:}]
}{%
but this doesn't work with tex4ht
for some reason. But there is also no reason to use \item
this way, you may just define notelist
environment this way:
\definecolor{notecolor}{cmyk}{1,0,0.16,0.09}
\newenvironment{notelist}{%
\leavevmode\noindent{\notefont\textcolor{notecolor}{Note:}}
\begin{itemize}
}{%
\end{itemize}%
}
We defined notecolor
to be used here, because I think it is better to use logical names, it will enable you to change the color easily in the future. Now you need to create a custom config file and put these declarations:
\Preamble{xhtml}
\newcommand\colortohtml[2]{%
\extractcolorspec{#1}{\tmp}%
\expandafter\convertcolorspec\tmp{HTML}#2
}
\newcommand\declarehcolor[1]{%
\colortohtml{#1}\tmp%
\Configure{HColor}{#1}{\#\tmp}%
}
\declarehcolor{notecolor}
\begin{document}
\EndPreamble
commands from xcolor
package are used here to convert named color to rgb value. note that when you use cmyk
colors, the resulting color may be slightly different due to the conversion.
Now compile the file with
htlatex filename cfgname
