DevactionUI.Tone (devaction_ui v0.2.3)

Copy Markdown View Source

The tones of the canvas 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 five of meaning are :risk, :warn, :ok, :info and :neutral; :indigo and :emerald are the tints of people and of work in review (the default avatar, the "reviewing" dot); :chart_1 to :chart_4 are drawn from the --chart-* series colors, for what a chart or a calendar paints by series.

fill/1 is the solid of a bar and dot/1 the status dot: the dot is the brighter green, indigo or amber of the canvas, the bar the same color as the text of the tone.

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

Only the background of a tinted surface, for what has no border.

The solid of a status dot: the brighter shade the canvas draws "connected" and "reviewing" in.

A solid fill of the tone, for bars.

The tone a callout or alert kind is drawn in.

The darker text of the tone, for the title and body of a tinted alert or callout.

Border and background of a tinted surface.

The text color that goes on that surface.

Types

kind()

@type kind() :: t() | :ai | :warning | :decision | :tip | :note

t()

@type t() ::
  :risk
  | :warn
  | :ok
  | :info
  | :neutral
  | :indigo
  | :emerald
  | :chart_1
  | :chart_2
  | :chart_3
  | :chart_4

Functions

bg(atom)

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

Only the background of a tinted surface, for what has no border.

dot(atom)

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

The solid of a status dot: the brighter shade the canvas draws "connected" and "reviewing" in.

fill(atom)

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

A solid fill of the tone, for bars.

from_kind(kind)

@spec from_kind(kind()) :: t()

The tone a callout or alert kind is drawn in.

strong(atom)

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

The darker text of the tone, for the title and body of a tinted alert or callout.

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.