Instrument
Version v0.12.0 GitHub

2. Color

Color belongs to values, to state and to the tenant. The case around them is a neutral, so it takes no side against a tenant's hue.

The Three Anchors

NCode Blue #0033CC, NCode Blue Light #809FFF and NCode Navy #0A1F5C are the logo kit's colors, and the blue ramp passes through all three. NCode Blue is what you press on NCode's own surfaces; Blue Light is the same blue on a dark page; Navy is the deep field of a screen. The derivation is calibrated on them: NCode Blue lifted to the dark theme is exactly Blue Light, and NCode Blue as a screen is exactly Navy.

Ramps

The ramps are built in OKLCH from src/tokens.source.json. Blue passes through the logo kit's three colors and bends its hue the way they do. Stone is a neutral with a trace of warm olive. Green, red and amber are stepped by lightness the same way. The ramps are primitives: components never read them.

RampUseSteps
BlueBrand50 #F2F5FF · 100 #E4EBFF · 200 #C3D2FF · 300 #809FFF (NCode Blue Light) · 400 #557EFA · 500 #2757E8 · 600 #0033CC (NCode Blue) · 700 #032AA7 · 800 #08257F · 900 #0A1F5C (NCode Navy) · 950 #071339
StoneNeutral0 #FFFFFF · 50 #F7F7F4 · 100 #F0F0ED · 200 #E9E9E4 · 300 #D9D9D4 · 400 #BEBEB8 · 450 #93938C · 500 #797972 · 600 #5E5E58 · 700 #4B4B45 · 800 #343430 · 850 #282824 · 900 #1E1E1B · 925 #171714 · 950 #11110F · 975 #0A0A08
GreenSuccess50 #ECFAEF · 100 #D3F5DB · 300 #7ADE95 · 500 #20A04E · 600 #11813C · 700 #126630 · 800 #0D4A22 · 900 #083518 · 950 #092210
AmberWarning, hazard, hot50 #FFF6E1 · 100 #FFECB8 · 300 #FAC13B · 400 #F4AD1D · 500 #DC8900 · 600 #B96A00 · 700 #8F4D05 · 800 #623606 · 900 #442504 · 950 #2A1907
RedDanger50 #FFF2F0 · 100 #FFE2DF · 300 #FF958D · 500 #DE3C37 · 600 #C01F1C · 700 #9C1B18 · 800 #711612 · 900 #4D1612 · 950 #31100D

Roles

Components read roles, never ramp steps. Each role is one custom property, --nc-color-<role>, written once: as light-dark(<light>, <dark>) where the themes differ, and as one value where they don't. The token reference has every value.

GroupRolesWhat they are
Casepage, page-sunken, surface, surface-raised, surface-sunken, wellThe case, a plate, the brightest sheet, a recess, a field
Keyscontrol, control-hover, control-pressed, ghost-hover, ghost-pressedThe face of a neutral key in each state
Linesborder, border-strong, lamp-unlitA hairline, the edge of a control (3 to 1), an unlit lamp
Typetext, text-secondary, text-muted, text-disabled, code-tintRunning text, secondary text, engraved labels, disabled text, the tint behind inline code
Primaryprimary, on-primary, primary-shade, primary-hover, primary-pressed, primary-edge, primary-lip, primary-text, primary-subtle, primary-subtle-border, focusWhat you press, derived from --nc-brand
Screenscreen, screen-raised, screen-border, screen-lit, on-screen, on-screen-secondary, on-screen-muted, screen-hotWhat you are shown, derived from --nc-brand-secondary
Scopescope-tenant, scope-team, scope-platformThe ink of a brace, one per kind of boundary
Statussuccess, warning, danger, info, each with on-, -mark, -text, -subtle, -border; and danger-hover, danger-lip-mark is a lamp, icon or line (3 to 1). -text is running text (4.5 to 1). A danger key has a hover and a lip of its own
Hazardhazard, on-hazardTape, the same in both themes
Depthlip, shade, screen-shade, glint, shadow, scrimThe side of a raised part, the shadow in a recess or under a screen's top edge, light on an edge
MarkslogoNCode's marks: Blue, or Blue Light on dark

Reach for the role that names what the part is, not the one whose value looks right: primary-text for the brand as text, a line or a lamp, never primary, which is a key's face and may be too light to read.

What Amber Means

Amber is the one supporting hue, and it means "this is not routine": a warning, hazard tape, and on a screen a literal or a sensitive value. Nothing else is amber. A highlight, a badge or a new feature takes another treatment.

A Theme

A theme is nothing but the root's color-scheme: the page follows the reader's system setting until data-theme pins it to light or dark. On paper a page takes the light theme. A screen is the same in both themes, as hazard tape is.

Computed Contrast

The lowest ratio of each use, light then dark. "Tenants" is the lowest of the four tenant combinations: teal #0F766E, orange #C2410C, teal with rust #7C2D12 and orange with navy #1E3A5F. "Stress" is the lowest of six colors chosen to break the derivation: yellow #FACC15, sky #38BDF8, red #DC2626, green #16A34A, near white #F1F5F9 and near black #111827. build.mjs computes every ratio from the tokens and fails when one is below its requirement; Accessibility says what is measured and why.

UsePairingsNeedsNCode BlueTenantsStress
Text94.512.68 / 10.94
Text on a ghost key, touched34.512.21 / 9.39
Secondary text74.56.19 / 7.92
Engraved labels, setting keys, placeholders54.55.35 / 4.78
Inline code44.513.06 / 10.31
Edge of a control633.09 / 3.37
NCode's mark437.35 / 5.86
Brand as text, lamp, focus ring64.57.35 / 5.685.10 / 5.524.84 / 5.50
Primary key: label14.58.95 / 7.165.17 / 6.974.82 / 6.91
Primary key, hover14.511.11 / 8.996.97 / 8.826.52 / 8.73
Primary key, pressed14.512.77 / 5.478.59 / 5.328.08 / 5.30
Primary key against its plate: its face337.35 / 5.864.25 / 5.68
Primary key against its plate: its edge or its face3310.48 / 5.867.05 / 5.683.90 / 5.61
Text on a selected option14.515.69 / 12.5616.09 / 12.4214.92 / 12.40
Secondary text on a selected option14.57.67 / 7.687.86 / 7.597.29 / 7.58
Screen: values14.515.40 / 15.4014.79 / 14.7914.52 / 14.52
Screen: code14.510.23 / 10.239.99 / 9.999.92 / 9.92
Screen: comments, unlit steps14.56.63 / 6.636.46 / 6.466.41 / 6.41
Screen: keywords, lit labels, braces14.56.10 / 6.105.95 / 5.955.95 / 5.95
Screen: literals, hot bytes, a secret14.59.35 / 9.358.98 / 8.988.82 / 8.82
Lit row: values14.512.42 / 12.4211.75 / 11.7511.27 / 11.27
Lit row: code14.58.25 / 8.257.93 / 7.937.70 / 7.70
Lit row: keywords14.54.92 / 4.924.80 / 4.804.80 / 4.80
Lit row and memory cells: literals14.57.54 / 7.547.13 / 7.136.85 / 6.85
Focus ring on a screen234.92 / 4.924.80 / 4.804.80 / 4.80
Material UI's secondary as text: the screen, lit in dark64.512.64 / 5.8612.14 / 5.6811.92 / 5.61
Boundary plate: tenant14.56.10 / 6.105.95 / 5.955.95 / 5.95
Boundary plate: team14.515.40 / 15.4014.79 / 14.7914.52 / 14.52
Boundary plate: platform; hazard band14.59.27 / 9.27
Boundary plate against its plate: tenant (bezel or fill)3313.48 / 5.8612.96 / 5.6812.71 / 5.61
Boundary plate against its plate: team (bezel or fill)3313.48 / 14.7912.96 / 14.7912.71 / 14.79
Boundary plate against its plate: platform (bezel or fill)3313.48 / 7.6312.96 / 7.6312.71 / 7.63
Scope brace: tenant237.35 / 7.115.10 / 6.904.84 / 6.82
Scope brace: team2314.74 / 15.73
Scope brace: platform (the stronger stripe of the tape)2314.74 / 9.27
Success: text44.55.80 / 8.95
Success: lamp, icon, bar534.07 / 8.95
Success: label on fill14.54.96 / 10.18
Success: alert text14.516.66 / 14.73
Warning: text44.55.33 / 8.98
Warning: lamp, icon, bar533.36 / 8.98
Warning: label on fill14.59.27 / 9.27
Warning: alert text14.516.69 / 14.82
Danger: text54.56.67 / 7.00
Danger: lamp, icon, bar534.99 / 7.00
Danger: label on fill14.56.07 / 8.20
Danger: alert text14.516.43 / 15.19
Info: text44.59.10 / 5.86
Info: lamp, icon, bar537.35 / 5.86
Info: label on fill14.58.95 / 7.16
Info: alert text14.516.49 / 15.83
Danger: key, hover14.58.12 / 9.73

1110 measurements of 136 pairings: 0 below the requirement.