Documentation
¶
Overview ¶
Package envcolor resolves the colour an environment is drawn in.
Six built-in hues. Well-known slugs get a fixed default (production red, staging amber, dev violet); every other static env takes the next unused hue in ladder order. Overrides, most specific wins: the env row's own colour (the config file on a managed stack, stack settings otherwise), the org's default for that slug, then these defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Names = []string{"teal", "sky", "lime", "amber", "rose", "violet"}
Names are the palette, in ladder order. Each is a --rw-env-<name> token in css/input.css, tuned per theme, which is why a name is stored rather than a hex: the same env reads right in light and dark.
Functions ¶
func Map ¶
Map resolves every env of one stack, keyed by env id. envs is the stack's list in store order (the ladder). managed says the stack's config file owns the env rows, which only changes what Source reports.
func OrgDefaults ¶
OrgDefaults parses the org row's slug to colour map. Nil-safe.
Types ¶
type Resolved ¶
type Resolved struct {
Value string // palette name or hex
CSS string // CSS(Value)
Source string // file | stack | org | default
}
Resolved is one env's colour and where it came from.
func For ¶
func For(env *repo.Environment, envs []repo.Environment, org *repo.Org, managed bool) Resolved
For resolves one env. envs must be the stack's full list.