marianoguerra/wax/colors does not have a README file

    Flag

    pub(all) enum Flag {
    Never
    Always
    Auto
    } derive(Eq,
    Debug
    )

    Whether to emit ANSI colour.

    Style

    pub(all) enum Style {
    Keyword
    Instruction
    Attribute
    Type
    Identifier
    Constant
    Str
    Operator
    Annotation
    Comment
    Punctuation
    } derive(Eq,
    Debug
    )

    A semantic category for syntax highlighting.

    Semantic rather than literal -- a Type is whatever the active palette says a type looks like, which is why Wax types come out cyan and WAT types red from the very same printer.

    Theme

    pub(all) struct Theme {
    keyword : String
    instruction : String
    attribute : String
    type_ : String
    identifier : String
    constant : String
    str : String
    operator : String
    annotation : String
    comment : String
    punctuation : String
    reset : String
    }

    The ANSI escape code to introduce each style, plus the one that ends it.

    An empty string means "this style is not coloured", which is how no_color disables everything and how a palette opts one category out.

    Theme::escape_sequence

    fn Theme::escape_sequence(self : Theme, style : Style) -> String

    blue

    let blue : String

    bold

    let bold : String

    cyan

    let cyan : String

    green

    let green : String

    grey

    let grey : String

    high_red

    let high_red : String

    high_yellow

    let high_yellow : String

    magenta

    let magenta : String

    no_color

    let no_color : Theme

    A palette that colours nothing.

    red

    let red : String

    reset

    let reset : String

    Raw ANSI codes.

    should_use_color

    fn should_use_color(color : Flag, is_tty? : Bool) -> Bool

    Whether to emit colour on a destination.

    is_tty is passed in rather than probed here, so the decision stays testable and this package needs no knowledge of file descriptors. Under Auto colour is suppressed by NO_COLOR, by a dumb or absent TERM, and by the destination not being a terminal -- all three, not any one.

    wat_theme

    let wat_theme : Theme

    The WebAssembly-text palette. Types are red here against Wax's cyan.

    wax_theme

    let wax_theme : Theme

    The Wax source palette.

    One palette per surface language, each the single source of truth: the language's own printer renders whole modules with it, and a diagnostic colours an embedded AST fragment with it. So a message about Wax code colours its types the same way Wax source does.

    white

    let white : String

    yellow

    let yellow : String

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io