I am trying to define an rgb color. More specifically I want to create this color
which in rgb
mode it's (98,190,177)
.
I tried to define this color using the following code
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\definecolor{tank}{rgb}{0.098,0.190,0.177}
%\definecolor{tank}{rgb}{98,190,177}
\begin{tikzpicture}
\coordinate (tank) at (0,0);
\draw[red, fill=tank] (-2,0.5)--(-0.5,1)--(0.5,1)--(2,0.5)--(2,-0.5)--(0.5,-1)--(-0.5,-1)--(-2,-0.5)--cycle;
\end{tikzpicture}
\end{document}
but the output is totally different from what I am trying to achieve
I also tried to use \definecolor{tank}{rgb}{98,190,177}
but I get no color at all. How to properly define an rgb color?
Best Answer
The colors in the screenshot are specified as
Package
xcolor
supports RGB and HTML directly and HSV is indirectly supported via Hsb, where the saturation and brightness are given in range [0..1].Package
color
only supports the basic color models such asrgb
:Because of the different range, the values needs to be calculated first.