Sign in

    moonrockz/diagrams-svg/theme does not have a README file

    Color

    pub struct Color {
    r : Int
    g : Int
    b : Int
    alpha : Int
    } derive(Eq,
    Debug
    )

    An sRGB colour. alpha is the opacity in percent, from 0 to 100.

    Color::equal

    fn Color::equal(Color, Color) -> Bool

    Color::hex

    fn Color::hex(value : Int) -> Color

    An opaque colour from a hex value, for example 0x020617.

    Color::not_equal

    fn Color::not_equal(x : Color, y : Color) -> Bool

    Color::rgba

    fn Color::rgba(r : Int, g : Int, b : Int, alpha : Int) -> Color

    A colour with the opacity alpha in percent.

    Color::tint

    fn Color::tint(self : Color) -> Color

    Author colours have 18 percent opacity, multiplied by any authored alpha.

    Color::to_css

    fn Color::to_css(self : Color) -> String

    CSS text for the colour: #rrggbb when it is opaque, else rgba(...).

    Color::to_repr

    Family

    pub(all) enum Family {
    Frontend
    Backend
    Database
    Cloud
    Security
    MessageBus
    External
    } derive(Eq,
    Debug
    )

    A colour family of the archify classic preset.

    Family::equal

    fn Family::equal(Family, Family) -> Bool

    Family::name

    fn Family::name(self : Family) -> String

    The name of the family, as used in CSS class and variable names.

    Family::not_equal

    fn Family::not_equal(x : Family, y : Family) -> Bool

    Family::to_repr

    FamilyColors

    pub(all) struct FamilyColors {
    fill : Color
    stroke : Color
    ink : Color
    } derive(Eq,
    Debug
    )

    The colours of one family. fill and stroke are archify's values. ink is the colour of text in this family, with at least 4.5:1 contrast.

    FamilyColors::equal

    FamilyColors::not_equal

    fn FamilyColors::not_equal(x : FamilyColors, y : FamilyColors) -> Bool

    Palette

    pub(all) struct Palette {
    bg : Color
    text : Color
    muted : Color
    mask : Color
    arrow : Color
    frontend : FamilyColors
    backend : FamilyColors
    database : FamilyColors
    cloud : FamilyColors
    security : FamilyColors
    messagebus : FamilyColors
    external : FamilyColors
    } derive(Eq,
    Debug
    )

    The colours of one theme variant, dark or light.

    Palette::equal

    fn Palette::equal(Palette, Palette) -> Bool

    Palette::family

    fn Palette::family(self : Palette, f : Family) -> FamilyColors

    The colours of the family f.

    Palette::not_equal

    fn Palette::not_equal(x : Palette, y : Palette) -> Bool

    Palette::to_repr

    Theme

    pub(all) struct Theme {
    dark : Palette
    light : Palette
    } derive(Eq,
    Debug
    )

    A theme with a dark and a light variant.

    Theme::classic

    fn Theme::classic() -> Theme

    The classic preset of archify (MIT), in dark and light. In the light variant, the ink of six families is a darker shade of the same hue, because archify's colour has less than 4.5:1 contrast as text.

    Theme::equal

    fn Theme::equal(Theme, Theme) -> Bool

    Theme::not_equal

    fn Theme::not_equal(x : Theme, y : Theme) -> Bool

    Theme::to_repr

    all_families

    let all_families : ReadOnlyArray[Family]

    The families, in the order of the CSS that the renderer writes.

    contrast

    fn contrast(a : Color, b : Color) -> Double

    The WCAG 2 contrast ratio of two opaque colours, from 1 to 21.

    family_of

    fn family_of(kind :
    ParticipantKind
    , cycle_index : Int) -> Family

    The colour family of a participant kind. A participant with no specific kind gets the family at cycle_index of a fixed cycle.

    luminance

    fn luminance(c : Color) -> Double

    The relative luminance of an opaque colour, as WCAG 2 defines it.

    over

    fn over(top : Color, bottom : Color) -> Color

    The opaque colour of top painted over the opaque colour bottom.

    parse_color

    fn parse_color(source : String) -> Color?

    Read CSS named colours, #rgb[a], #rrggbb[aa], rgb() and rgba(). Values that need a viewer context, such as currentColor, are deliberately unresolved.

    text_shade

    fn text_shade(accent : Color, backgrounds : ArrayView[Color]) -> Color

    Lower HSL lightness in 0.01 steps, retaining hue and saturation. Both the background and opaque chips must pass. Classic dark accents pass unchanged.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io