Skip to content

color

Color

Bases: Color

__str__()

Convert color to RGB string for Typst rendering.

Why

Typst templates need colors as rgb(r,g,b) strings. Override ensures Color objects serialize correctly in Jinja2 templates.

Returns:

  • str

    RGB string like "rgb(255, 0, 0)".

Source code in src/rendercv/schema/models/design/color.py
def __str__(self) -> str:
    """Convert color to RGB string for Typst rendering.

    Why:
        Typst templates need colors as rgb(r,g,b) strings. Override ensures
        Color objects serialize correctly in Jinja2 templates.

    Returns:
        RGB string like "rgb(255, 0, 0)".
    """
    return self.as_rgb()