Color is more than RGB
Why a useful color engine must reason about perceptual spaces, gamut, hue paths and contrast—not just hexadecimal values.
A hexadecimal value is an encoding of a color for a particular output space. It says remarkably little about how to move between two colors, whether a color can be displayed on a given screen, or whether a foreground remains legible over a background. Those are separate questions, and the core treats them as separate operations.
The color space changes the path.
PFx Color Core currently exposes parsing, conversion, interpolation, gamut mapping, contrast and perceptual difference through a UI-independent TypeScript engine. An adapter backed by colorjs.io supplies the current color calculations. The gradient builder accepts named interpolation spaces and a hue-path option, then samples the result through that engine. The source code deliberately checks that stop positions lie between zero and one and sorts them without losing the original ordering of equal-position stops.
A halfway point in sRGB need not resemble a halfway point in OKLCH. sRGB interpolates its encoded channel values; OKLCH offers a lightness/chroma/hue representation that can produce a different perceptual journey. Circular hue brings an extra decision: for two hues, the shortest route around the circle is not the only route. The gradient builder exposes hue direction rather than silently choosing an unexamined path.
Color has boundaries.
An interpolated color can exist mathematically without fitting inside the target display gamut. The core distinguishes color conversion from gamut mapping; its sampled gradient specifies both the interpolation space and the output space. Its visual output also needs to account for alpha. In the separate Rust implementation now under development, interpolation uses premultiplied-alpha channels while leaving hue angular, and its documentation explicitly avoids promising complete CSS color-mix() equivalence.
Contrast and difference are not interchangeable.
The TypeScript adapter exposes WCAG 2.1 and APCA contrast calculations and multiple difference metrics, including Delta E in different spaces. Contrast concerns the relationship between text and background; perceptual difference concerns the separation between two colors. Neither metric, on its own, makes a palette accessible or aesthetically appropriate. Context, size, adaptation and output device still matter.
What is shipping, and what is still changing.
The PFx Colors application uses a revision-pinned copy of the existing TypeScript engine. A dependency-free Rust implementation and portable bindings are being developed in parallel; they have not replaced that production TypeScript path. The versioned core is an extraction of working behavior, not a claim that every color algorithm has already been rewritten from scratch. The visual comparison below uses the browser's native CSS color-mix() as a teaching example, not the PFx computation engine.
Explore the principle.
Native CSS color-mix() comparison. It illustrates the concept; this panel does not execute PFx Color Core.