noctua_colors/lib.rs
1//! **A colour system compiler.** A small declarative specification goes in;
2//! every artifact other projects consume comes out.
3//!
4//! # This crate contains no code
5//!
6//! It exists so that the project's name on crates.io belongs to the project.
7//! There is deliberately nothing to call here, and depending on it does nothing.
8//! What you probably want is one of these instead:
9//!
10//! | You are | Use |
11//! |---|---|
12//! | Painting in Rust — Dioxus, egui, a TUI, a graphics API | [`noctua-colors-tokens`](https://crates.io/crates/noctua-colors-tokens) |
13//! | Styling a web view or a website | the CSS custom properties |
14//! | Using Tailwind v4 | the generated theme, one `@import` |
15//! | Running a design-token pipeline | the DTCG tokens |
16//! | Writing Qt or Quickshell | the QML singleton |
17//!
18//! Every route is documented at
19//! <https://github.com/noctua-world/noctua-colors>, and the palette is browsable
20//! at <https://noctua-world.github.io/noctua-colors/>.
21//!
22//! # What the system actually is
23//!
24//! Not a palette, and not a UI library: **the repository versions the curves,
25//! not the colours.** No hand-picked hex value exists anywhere in its source.
26//! Two ideas carry it.
27//!
28//! **Relative chroma.** Chroma is a fraction of what the target gamut can show
29//! at that lightness and hue, rather than an absolute number. So one definition
30//! renders correctly on sRGB and more vividly on Display P3 without being
31//! redefined, and "sober ↔ vivid" is a single multiplier.
32//!
33//! **Contrast-anchored steps.** A step's lightness is *solved* from an APCA
34//! contrast target against a declared reference, not authored as a ramp. Which
35//! means the contrast guarantees are a property of how the colours were made,
36//! not a spreadsheet somebody checked once.
37//!
38//! Quality gates run before anything is emitted: an APCA contrast matrix across
39//! every family, colour-vision-deficiency margins under all three dichromacies,
40//! perceptual spacing, and a check that no consumer references a token that does
41//! not exist. The gates publish their measurements rather than a verdict —
42//! including the ones no palette can pass, because a limit you can see is worth
43//! more than a claim you cannot check.
44//!
45//! # Why the compiler is not published
46//!
47//! Its crates are marked `publish = false`. They are an implementation of one
48//! specification, not a general-purpose colour library, and their API is shaped
49//! entirely by that job — publishing them would promise a stability nobody
50//! needs and nothing would benefit from. The output is the product.
51//!
52//! # Licence
53//!
54//! MIT OR Apache-2.0.
55
56// Nothing is exported. The crate is documentation, and a reader who lands here
57// looking for an API should be sent somewhere useful rather than given an empty
58// module to wonder about.
59#![no_std]