All notable changes to this project will be documented in this file. This change log follows the conventions of keepachangelog.com.
rgb->oklab converts sRGB vectors with channels from 0 to 255 into Oklab
[l a b] coordinates at full precision, with lightness on a 0 to 1 scaleround-coords rounds each value in a coordinate vector to a number of
decimal places or significant digits, for display and exportoklab->rgb converts Oklab coordinates back to sRGB at full precision,
without clamping, as the exact inverse of rgb->oklaboklab->hex converts Oklab coordinates to a hex string, clamping colors
outside sRGBin-gamut? checks whether Oklab coordinates fall inside the sRGB gamutclamp-rgb clamps computed RGB channels to 0 to 255 before ->hex or
coloroklab->oklch, oklch->oklab, rgb->oklch, oklch->rgb and oklch->hex
convert to and from OKLCh, the lightness, chroma and hue form CSS oklch()
usesoklab() and oklch() inputaccessible?, find-accessible-color, get-contrast-text and
accessible-theme compared the contrast ratio after rounding it to 2
decimal places, so pairs just below a WCAG threshold passed. They now
compare the unrounded ratio. contrast-ratio still returns a rounded value.
accessible-theme output changes for brands near a threshold: #006ffb
now gets black :on-primary text instead of white (4.4999:1).accessible?.hsl(0°, 0%, 0%) and
hsv(0°, 0%, 0%)round overflowed a long on the JVM for large values at high precision:
(round 40000.0 15) returned 9223.37. It now returns the value unchanged
once no fractional digit is left at the requested precision.valid-hex? returned a regex match vector or nil instead of true or
false. Code that used it as a condition is unaffected; code that read the
match vector or tested for nil relied on undocumented behavior.kelvin->rgb made every temperature above 6600 K too blue: it scaled red
and green by 255 instead of Helland's coefficients. 10000 K now gives
[202 218 255] instead of [156 193 255].rgb->kelvin returned wrong temperatures: it skipped the conversion to CIE
xy chromaticity and had two coefficient signs flipped, so a 2700 K warm white
came back as 24514 K. It now returns 6504 K for sRGB white and nil for
colors far from the black-body curve, as documented.accessible-theme - Builds light or dark theme tokens with WCAG-aware
foreground colors, semantic roles, focus ring, border, and color scaletheme->css-vars - Exports generated theme tokens as CSS custom
properties for direct frontend useblend-multiply - Multiply blend mode (darkens)blend-screen - Screen blend mode (lightens)blend-overlay - Overlay blend mode (combines multiply and screen)tint - Mix color with white (lightens while preserving hue)shade - Mix color with black (darkens while preserving hue)tone - Mix color with gray (reduces saturation)tints, shades, tones - Generate series of variationsalpha-blend - Porter-Duff alpha compositingwith-alpha - Set alpha channel of any colorinterpolate - Interpolate between multiple colors in RGB, HSL, or HSV spacegradient - Generate gradients with n steps between colorsrgb->lab - Convert to CIE L*A*B* color spacedelta-e - Calculate perceptual difference using CIE76 Delta E formulaperceptually-similar? - Check similarity using JND (Just Noticeable Difference)kelvin->rgb, kelvin->hex, kelvin->color - Convert temperature to colorrgb->kelvin - Approximate color temperature from RGBrgb() and rgba() color strings
valid-css-rgb? and valid-css-rgba? validation functionsparse-css-rgb and parse-css-rgba parsing functionsnormalize-css-color-string for flexible formatting support"rgb(255, 0, 0)", "rgba(255, 0, 0, 0.5)""rgb(255 0 0)", "rgba(255 0 0 0.5)""RGB(255, 0, 0)", "RGBA(255, 0, 0, 1)""rgb( 255 , 0 , 0 )", "rgba( 255 0 0 0.8 )""rgba(255, 0, 0, .5)"(color "rgb(255, 0, 0)")(->rgb "rgba(255, 0, 0, 0.8)")(lighten "rgb(255, 0, 0)" 0.2)color function now accepts any color input type, including existing Color records->name function that finds closest color names from any color input typenormalize-color-input function provides consistent color type handling across all functionsparse-float utility for consistent number parsingnormalize-color-input private for internal useparse-int utility function for cross-platform compatibilityget-contrast-text function to determine best contrast text colorhex->rgb, rgb->hex, hex->rgba, rgba->hexrgb->hsl, hsl->rgb, hex->hsl, hsl->hexrgb->hsv, hsv->rgbvalid-hex?, valid-rgb?, valid-rgba?, valid-hsl?lighten, darken, saturate, desaturateadjust-hue, invert, grayscalemix - blend two colors with configurable ratioluminance, contrast-ratio, accessible?find-accessible-color - automatically find WCAG-compliant colorscomplementary, triadic, tetradic, analogousmonochromatic, split-complementarygenerate-palette with multiple strategiesbrightness, dark?, light?, vibrant?, muted?warm?, cool?, temperaturecolor-distance, similar?name->hex, hex->nameCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |