Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrColors = errors.New("brand: colors must use #RRGGBB") ErrFont = errors.New("brand: invalid font") ErrWidth = errors.New("brand: invalid page width") ErrTextContrast = errors.New("brand: text needs at least 4.5:1 contrast against the background") ErrButtonContrast = errors.New("brand: no readable label color reaches AA on this accent; choose a less mid-toned accent") )
Functions ¶
func OnAccent ¶ added in v0.18.0
OnAccent is the label color for a fill of accent: white when it reaches WCAG AA 4.5:1, else near-black, else black. For any opaque color white and black multiply to a contrast of 21, so one always reaches at least sqrt(21) ~= 4.58:1 — a readable label always exists, and a light accent such as amber keeps readable labels instead of being rejected. The builder's brand CSS uses this; the theme identity layer applies the same rule and will share this implementation in a later change. accent must be #RRGGBB (as Validate requires); other input returns white.
Types ¶
Click to show internal directories.
Click to hide internal directories.