DevactionUI.Tone (devaction_ui v0.1.0)

Copy Markdown View Source

The five tones of the canvas (:risk, :warn, :ok, :info, :neutral) as class strings, so every component that tints something (a callout, a finding, an alert, a progress bar) takes the same colors from the same tokens and flips with the theme.

The canvas names kinds by meaning (note, ai, tip, warning, decision); from_kind/1 turns a kind into the tone it is drawn in.

Summary

Functions

A solid fill of the tone, for bars and dots.

The tone a callout or alert kind is drawn in.

Border and background of a tinted surface.

The text color that goes on that surface.

Types

t()

@type t() :: :risk | :warn | :ok | :info | :neutral

Functions

fill(atom)

@spec fill(t()) :: String.t()

A solid fill of the tone, for bars and dots.

from_kind(kind)

@spec from_kind(atom()) :: t()

The tone a callout or alert kind is drawn in.

surface(atom)

@spec surface(t()) :: String.t()

Border and background of a tinted surface.

text(atom)

@spec text(t()) :: String.t()

The text color that goes on that surface.