Saturon LogoSaturon

🚧 This documentation covers a pre-1.0 release. Expect breaking changes.

API

TypeScript Types

Documentation of TypeScript types and interfaces in Saturon.

The "saturon/types" module exports various TypeScript types and interfaces used throughout the Saturon library. These types help ensure type safety and provide better developer experience when working with colors.

Exported Types

NameDescription
ColorTypeUnion of all <color> syntaxes
ColorBaseUnion of all <color-base> syntaxes
ColorModelUnion of all color-model names
ColorSpaceUnion of all color-space names
NamedColorUnion of all <named-color> names
ColorConverter{ isValid, bridge, toBridge, parse, fromBridge?, format? }
ColorModelConverterExtends ColorConverter with components, targetGamut, etc.
ColorSpaceConverterMatrix-based converter for <color()>
ComponentDefinition{ index, value, precision? }
FitMethod"none" | "clip" | "chroma-reduction" | "css-gamut-map"
FitFunction(coords, model, opts) => number[]
Plugin(ColorClass: typeof Color) => void
ConfigGlobal configuration shape
FormattingOptionsOptions for to() and toString()
GetOptionsOptions for toArray() and toObject()
RandomOptionsOptions for random()
MixOptionsOptions for mix()

On this page