lustre/ui/colour

Types

pub type Colour =
  colour.Colour
pub type ColourPalette {
  ColourPalette(
    base: ColourScale,
    primary: ColourScale,
    secondary: ColourScale,
    success: ColourScale,
    warning: ColourScale,
    danger: ColourScale,
  )
}

Constructors

  • ColourPalette(
      base: ColourScale,
      primary: ColourScale,
      secondary: ColourScale,
      success: ColourScale,
      warning: ColourScale,
      danger: ColourScale,
    )
pub type ColourScale {
  ColourScale(
    bg: Colour,
    bg_subtle: Colour,
    tint: Colour,
    tint_subtle: Colour,
    tint_strong: Colour,
    accent: Colour,
    accent_subtle: Colour,
    accent_strong: Colour,
    solid: Colour,
    solid_subtle: Colour,
    solid_strong: Colour,
    solid_text: Colour,
    text: Colour,
    text_subtle: Colour,
  )
}

Constructors

  • ColourScale(
      bg: Colour,
      bg_subtle: Colour,
      tint: Colour,
      tint_subtle: Colour,
      tint_strong: Colour,
      accent: Colour,
      accent_subtle: Colour,
      accent_strong: Colour,
      solid: Colour,
      solid_subtle: Colour,
      solid_strong: Colour,
      solid_text: Colour,
      text: Colour,
      text_subtle: Colour,
    )

Functions

pub fn amber() -> ColourScale
pub fn amber_dark() -> ColourScale
pub fn blue() -> ColourScale
pub fn blue_dark() -> ColourScale
pub fn bronze() -> ColourScale
pub fn bronze_dark() -> ColourScale
pub fn brown() -> ColourScale
pub fn brown_dark() -> ColourScale
pub fn contrast_ratio(a: Colour, b: Colour) -> Float
pub fn crimson() -> ColourScale
pub fn crimson_dark() -> ColourScale
pub fn cyan() -> ColourScale
pub fn cyan_dark() -> ColourScale
pub fn decoder(
  json: Dynamic,
) -> Result(ColourScale, List(DecodeError))
pub fn default_dark_palette() -> ColourPalette

Lustre UI’s default dark colour palette. You can use this if you don’t have any strict requirements around colours and you want to start building your app straight away.

This is the dark mode palette used by the default theme, but it is not required to only use this palette for dark mode!

pub fn default_light_palette() -> ColourPalette

Lustre UI’s default light colour palette. You can use this if you don’t have any strict requirements around colours and you want to start building your app straight away.

This is the light mode palette used by the default theme.

pub fn encode(scale: ColourScale) -> Json
pub fn encode_palette(palette: ColourPalette) -> Json
pub fn gold() -> ColourScale
pub fn gold_dark() -> ColourScale
pub fn grass() -> ColourScale
pub fn grass_dark() -> ColourScale
pub fn gray() -> ColourScale
pub fn gray_dark() -> ColourScale
pub fn green() -> ColourScale
pub fn green_dark() -> ColourScale
pub fn hsl(h: Float, s: Float, l: Float) -> Colour
pub fn indigo() -> ColourScale
pub fn indigo_dark() -> ColourScale
pub fn iris() -> ColourScale
pub fn iris_dark() -> ColourScale
pub fn jade() -> ColourScale
pub fn jade_dark() -> ColourScale
pub fn lime() -> ColourScale
pub fn lime_dark() -> ColourScale
pub fn luminance(colour: Colour) -> Float
pub fn mauve() -> ColourScale
pub fn mauve_dark() -> ColourScale
pub fn maximum_contrast(
  base: Colour,
  options: List(Colour),
) -> Colour
pub fn mint() -> ColourScale
pub fn mint_dark() -> ColourScale
pub fn olive() -> ColourScale
pub fn olive_dark() -> ColourScale
pub fn orange() -> ColourScale
pub fn orange_dark() -> ColourScale
pub fn palette_decoder(
  json: Dynamic,
) -> Result(ColourPalette, List(DecodeError))
pub fn pink() -> ColourScale
pub fn pink_dark() -> ColourScale
pub fn plum() -> ColourScale
pub fn plum_dark() -> ColourScale
pub fn purple() -> ColourScale
pub fn purple_dark() -> ColourScale
pub fn red() -> ColourScale
pub fn red_dark() -> ColourScale
pub fn rgb(r: Int, g: Int, b: Int) -> Colour
pub fn rgba(r: Int, g: Int, b: Int, a: Float) -> Colour
pub fn ruby() -> ColourScale
pub fn ruby_dark() -> ColourScale
pub fn sage() -> ColourScale
pub fn sage_dark() -> ColourScale
pub fn sand() -> ColourScale
pub fn sand_dark() -> ColourScale
pub fn sky() -> ColourScale
pub fn sky_dark() -> ColourScale
pub fn slate() -> ColourScale
pub fn slate_dark() -> ColourScale
pub fn teal() -> ColourScale
pub fn teal_dark() -> ColourScale
pub fn tomato() -> ColourScale
pub fn tomato_dark() -> ColourScale
pub fn violet() -> ColourScale
pub fn violet_dark() -> ColourScale
pub fn yellow() -> ColourScale
pub fn yellow_dark() -> ColourScale
Search Document