Utility Subpaths
Standalone, tree-shakable utility modules for direct functional workflows in Saturon.
Saturon provides its core features as standalone, tree-shakable utility subpaths. If you prefer a functional programming paradigm or need strict bundle-size optimizations, you can import these pure functions directly instead of using the object-oriented Color class.
Every method available on the Color class is powered by these underlying standalone functions.
saturon/colorMix
Statically mix multiple colors by percentages, replicating the exact W3C behavior of the CSS color-mix() function.
saturon/config
Manage and merge global runtime configuration settings for the Saturon engine.
saturon/contrast
Calculate the WCAG 2.1 relative luminance contrast ratio between two colors.
saturon/convert
Transform color coordinates between color models using graph pathfinding.
saturon/deltaE
Compute perceptual color differences using CIE76, CIE94, CIEDE2000, and OKLab algorithms.
saturon/format
Serialize raw color data into formatted, CSS-compliant strings and output specifications.
saturon/gamut
Check color gamut boundaries and fit out-of-bounds coordinates into physical gamut spaces.
saturon/getters
Query registered color models, spaces, keywords, fit methods, and model components from the engine.
saturon/interpolate
Generate functions to interpolate across multi-stop color palettes in specific models.
saturon/isValid
Check whether a string or token sequence is a valid, parseable CSS color or satisfies a target grammar rule.
saturon/parse
Parse CSS color strings, named colors, and shortcuts into raw color data objects.
saturon/random
Generate random color data objects with optional model constraints, channel limits, custom biases, and normal distributions.
saturon/registry
Inject or remove custom color models, formatters, syntax rules, and gamut spaces in Saturon.
saturon/scale
Generate discrete color palettes by sampling evenly across multi-stop color interpolations.
saturon/toArray
Export raw numeric arrays of component values, handling special values like NaN and Infinity with gamut fitting and precision options.
saturon/toObject
Export color data components mapped to a descriptive object with options for precision and gamut fitting.
saturon/updateColor
Functional utility for creating updated color coordinate arrays through flexible mutation patterns.