cdevienne/elm-orus-ui/1.0.0

Renamed to orus-io/elm-orus-ui. It is published under that name, and new versions come out there.

Versions published as cdevienne/elm-orus-ui still install under that name. 1 version of 1 come from the new location (see their notes).

Rerouted (renamed, needs approval). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/orus-io/elm-orus-ui.

What we checked: The repo moved to github.com/orus-io/elm-orus-ui and tag 1.0.0 is there; its commit ad645724a38d is from 2024-11-15 10:17 UTC, after the version was published (2024-11-15 09:57 UTC); elm.json differs from package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one and nothing else confirms its contents.

We could not verify this copy against what was published, so the Lamdera compiler asks before using it (y/n). Without a terminal, as in CI, it stops with an error unless approved:

  • lamdera make --auto-approve-package-rerouting approves rerouted versions for that run,
  • LAMDERA_AUTO_APPROVE_PACKAGE_REROUTING=1 does the same for every run in that environment,
  • LAMDERA_CACHE=off skips the Lamdera package server altogether: packages come from package.elm-lang.org and GitHub only, as with elm, and a rerouted version then fails to download.

Details · package.elm-lang.org's zip: https://github.com/cdevienne/elm-orus-ui/zipball/1.0.0/

OUI.Material.Color

Material 3 color utilities and scheme

Types

type alias KeyColors =
{ primary : Color
, secondary : Color
, tertiary : Color
, error : Color
, neutral : Color
, neutralVariant : Color
}

A set of colors suitable for generating a color scheme

type alias Scheme =
{ keyColors : KeyColors
, primary : Color
, primaryContainer : Color
, onPrimary : Color
, onPrimaryContainer : Color
, inversePrimary : Color
, secondary : Color
, secondaryContainer : Color
, onSecondary : Color
, onSecondaryContainer : Color
, tertiary : Color
, tertiaryContainer : Color
, onTertiary : Color
, onTertiaryContainer : Color
, surface : Color
, surfaceDim : Color
, surfaceBright : Color
, surfaceContainerLowest : Color
, surfaceContainerLow : Color
, surfaceContainer : Color
, surfaceContainerHigh : Color
, surfaceContainerHighest : Color
, surfaceVariant : Color
, onSurface : Color
, onSurfaceVariant : Color
, inverseSurface : Color
, inverseOnSurface : Color
, background : Color
, onBackground : Color
, error : Color
, errorContainer : Color
, onError : Color
, onErrorContainer : Color
, outline : Color
, outlineVariant : Color
, shadow : Color
, surfaceTint : Color
, scrim : Color
}

A Material 3 color scheme

type alias Theme =
{ name : String
, description : String
, keyColors : KeyColors
, schemes :
{ light : Scheme
, dark : Scheme
}
}

A Material color theme

Constructors

defaultKeyColors : KeyColors

The default Material 3 key colors

The default Material 3 light theme based on the default key colors

The default Material 3 dark theme based on the default key colors

defaultTheme : Theme

The default Material 3 theme

lightFromKeyColors : KeyColors -> Scheme

Create a light color scheme from key colors

darkFromKeyColors : KeyColors -> Scheme

Create a dark color scheme from key colors

makeTheme : String -> String -> KeyColors -> Theme

Build a theme

Getters

getColor : Color -> Scheme -> Color

Get a color of a scheme

getOnColor : Color -> Scheme -> Color

Get a "on" color of a scheme

getElementColor : Color -> Scheme -> Color

Get a color of a scheme directly as a 'Element.Color'

getOnElementColor : Color -> Scheme -> Color

Get a "on" color of a scheme directly as a 'Element.Color'

toElementColor : Color -> Color

Convert a Color to Element.Color

getContainerColor : Color -> Scheme -> Color

get a container color

getOnContainerColor : Color -> Scheme -> Color

get a "on container" color

getContainerElementColor : Color -> Scheme -> Color

get a "container" color directly as a 'Element.color'

getOnContainerElementColor : Color -> Scheme -> Color

get a "on container" color directly as a 'Element.color'

getSurfaceColor : Color -> Scheme -> Color

get the "surface" color

getOnSurfaceColor : Color -> Scheme -> Color

get the "on surface" color

getSurfaceVariantColor : Color -> Scheme -> Color

get the "surface variant" color

getOnSurfaceVariantColor : Color -> Scheme -> Color

get the "on surface variant" color

get the "surface container lowest" color

getSurfaceContainerLowColor : Color -> Scheme -> Color

get the "surface container low" color

getSurfaceContainerColor : Color -> Scheme -> Color

get the "surface container" color

getSurfaceContainerHighColor : Color -> Scheme -> Color

get the "surface container high" color

get the "surface container highest" color

The "hover" state layer opacity

The "focus" state layer opacity

The "press" state layer opacity

Helper functions

setAlpha : Float -> Color -> Color

set the opacity of a color

withShade : Color -> Float -> Color -> Color

Simulates adding a color in front (subtractive color mixing).

--Darkens the color by 50%
withShade (Color.rgb255 255 255 255) 0.5


--Makes the color 50% more red
withShade (Color.rgb255 255 0 0) 0.5
isError : Color -> Bool

returns true if the given color is a error color

tone : Int -> Color -> Color