Sign in

    This version of the module is deprecated: Use moonbitlang/pdflite instead

    bobzhang/pdflite/content/colour does not have a README file

    PdfContentColour

    pub(all) enum PdfContentColour {
    PdfContentGrey(Double)
    PdfContentRGB(Double, Double, Double)
    PdfContentCMYK(Double, Double, Double, Double)
    } derive(Eq, ToJson,
    Debug
    )

    Colour value used by cpdf-style content colour rewrite operations.

    PdfContentColour::to_draw_colour

    fn PdfContentColour::to_draw_colour(self : PdfContentColour) -> PdfDrawColour

    Convert a cpdf content colour into the draw colour variant.

    PdfDrawColour

    pub(all) enum PdfDrawColour {
    PdfDrawNoCol
    PdfDrawRGB(Double, Double, Double)
    PdfDrawGrey(Double)
    PdfDrawCYMK(Double, Double, Double, Double)
    } derive(Eq, ToJson,
    Debug
    )

    Colour specification used by cpdf draw operations.

    The CYMK spelling follows the OCaml source variant name in cpdfdraw.ml.

    pdf_colours

    fn pdf_colours() -> Array[(String, Int)]

    Source-spelled compatibility alias for cpdfcolours' colour table.

    pdf_content_black

    let pdf_content_black : PdfContentColour

    The default black content colour.

    pdf_css_colour_value

    fn pdf_css_colour_value(name : String) -> Int?

    Look up a CSS color by name using cpdf's lowercase color table.

    pdf_css_colours

    fn pdf_css_colours() -> Array[(String, Int)]

    Return the cpdf CSS color table as lowercase names paired with RGB integers.

    pdf_draw_colour_of_string

    fn pdf_draw_colour_of_string(text : String) -> PdfDrawColour

    Parse a cpdf draw colour, returning PdfDrawNoCol on malformed input.

    pdf_parse_colour

    fn pdf_parse_colour(text : String) -> PdfContentColour raise
    PdfError

    Source-spelled compatibility wrapper for cpdfdrawcontrol's parse_colour.

    pdf_parse_content_colour

    fn pdf_parse_content_colour(text : String) -> PdfContentColour raise
    PdfError

    Parse a cpdf draw/add-text colour argument.

    CSS colour names are converted to RGB values in the range 0.0..1.0. Numeric arguments follow cpdf's arity convention: one number is gray, three numbers are RGB, and four numbers are CMYK.

    pdf_parse_draw_colour

    fn pdf_parse_draw_colour(text : String) -> PdfDrawColour raise
    PdfError

    Parse a cpdf draw-control colour argument.

    This ports cpdfdrawcontrol.ml's parse_colour/col_of_string path while preserving the draw-layer NoCol sentinel separately from content colours.