#### 1.5.2 Commands and macros linked with colors

• Lcolor( <color> [, gray scale] ): macro that shows the three components red, green, blue of the given color in a list-form [r,g,b]. The second argument is not mandatory, is $0$ by default, if set to $1$, the color is converted into gray scale before computing the components.
• Bcolor( <color> ): macro that shows the blue level of the given color.
• Gcolor( <color> ): macro that shows the green level of the given color.
• Rcolor( <color> ): macro that shows the red level of the given color.
• Cplcolor( <color> ): macro that shows the complementary color level of the given color.
• Dark( <color>, <factor> ): macro that is doing a barycenter between the color and the black, the factor is a number in the interval [0;1] and is the proportion of black color (1=100%).
• Light( <color>, <factor> ): macro that is doing a barycenter between the color and the white, the factor is a number in the interval [O;1] and is the proportion of white (1=100%).
• GrayScale( <0/1> ): that command is described here. It is used to activate/desactivate the color conversion into gray scale.
• HexaColor( <Hexa value> ): The command is described here. Example: Color:=HexaColor("F5F5DC").
• MixColor( <color1>, <proportion1>, <color2>, <proportion2>, ..., <colorN>, <proportionN> ): macro that returns the color (rgb) obtained after combining the given colors and its corresponding proportions.
• Palette( <[Color1, Color2, ..., ColorN]>, <factor in [0;1]>): returns one color from the given palette in function of the factor, 0 for the first color, and 1 for the last.
• Hsb( <hue (0..360)>, <saturation (0..1)>, <brightness (0..1)> ): macro that returns a color from its components hue, saturation and brightness. Example: Color:=Hsb(60,1,1).
• HueColor( <color> ): returns the hue color’s component.
• SatColor( <couleur> ): returns the saturation color’s component.
• BrightColor( <couleur> ): returns the brightness color’s component.
• ColorJump( <color> ): macro that returns the constant jump and the <color> as the imaginary part. The Ligne command read the value and uses it as the fill color if the Fillstyle variable is empty (value none).
• Rgb( <red (0..1)>, <green (0..1)>, <blue (0..1)> ): the command is described here. Example: Color:= Rgb(0.5, 1, 0.6).
• RgbL( <[red, green, blue]> ): The macro has the same effect as Rgb, appart from the fact that the three component are in a list.
• Ryb( <red (0..1)>, <yellow (0..1)>, <blue (0..1)> ): macro that returns a color from its components red, yellow, blue. Example: Color:= Ryb(0.5, 0.8, 0.6).
• Rgb2Hsb( <couleur> ): macro for converting a color (rgb) into an Hsb color, ie a list [hue, saturation, brightness].
• Rgb2Hexa( <color Rgb> ): returns the string representing the Hexadecimal color code, eg: "FF0000" for the red color.
• Rgb2Gray( <color Rgb> ): returns the gray scale color (rgb form).

Exemple(s): Each facet is coloured according to the rating of the center of gravity. The color is added thanks to the ColorJump macro in the jump ending facet constant. The Hsb macro is made for continuously varying the color. Before drawing the surface, the facets are sorted using the SortFacet command, then are drawn.

 \begin{texgraph}[name=ColorJump, export=pgf]   view(-6.5,6,-6.5,5.5),   Marges(0,0,0,0),size(7.5),   view3D(-3,3,-3,3,-3,3),ModelView(central),   S:=GetSurface([u+i*v,2*sin(u)+cos(v)],                  -3+3*i,-3+3*i),   stock:=for facette in S By jump do      z:=Zde(isobar3d(facette)),      facette,      ColorJump(Hsb(270*(Zsup-z)/(Zsup-Zinf),1,1))           od,   FillStyle:=full, LabelSize:=footnotesize,   BoxAxes3D(grid:=1, FillColor:=lightblue),   Ligne3D(SortFacet(stock),1)   \end{texgraph}

Heat type colouring