Skip to main content

Module color

Module color 

Source

Enums§

Color
Color in a specific color model, matching Perl’s LaTeXML::Common::Color hierarchy.

Constants§

BLACK
Perl: use constant Black => bless [‘rgb’, 0, 0, 0], ‘…::rgb’;
WHITE
Perl: use constant White => bless [‘rgb’, 1, 1, 1], ‘…::rgb’;

Functions§

color_from_model_spec
Parse a color from model name + spec string. Perl: Color($model, components)->toCore
format_component
Format a float component like Perl: integers without decimal point.
from_model_components
Create a Color from model name and component values
is_core_model
Is model one of the core color models (Perl Color.pm %core_color_models: rgb, cmy, cmyk, hsb, gray)? Any other model must be a derived one (xcolor’s DefColorModel), else Perl’s Color::new reports Error:unexpected:<model> “Unrecognized color model” (Color.pm:59-61).