Moving from tinycolor2 to Colore
tinycolor2 was written before CSS had oklch(). Tailwind CSS v4 writes its default colors in OKLCH, and so do current shadcn/ui themes. Pass one of those colors to tinycolor2 and it doesn't throw an error. It returns black.
import tinycolor from 'tinycolor2';
tinycolor('oklch(0.6 0.2 260)').isValid(); // false
tinycolor('oklch(0.6 0.2 260)').toHexString(); // '#000000'
tinycolor('color(display-p3 1 0 0)').isValid(); // false
Colore reads every CSS Color 4 format, including oklch(), lab(), color() and color-mix(). It's written in TypeScript and ships its own types, where tinycolor2 needs @types/tinycolor2.
import { isValidColor, toHex } from 'colore-js/fn';
isValidColor('oklch(0.6 0.2 260)'); // true
toHex('oklch(0.6 0.2 260)'); // '#2e79f5'
npm install colore-js
The outputs on this page come from tinycolor2 1.6.0 and colore-js 2.0.1, run on December 3, 2026.
Calling Colore instead of tinycolor2
tinycolor2 wraps every color in an object, and you call a format method at the end. Colore's Color class chains the same way. Colore also has plain functions in colore-js/fn that take a color and return a CSS string, hex when the result fits sRGB.
import tinycolor from 'tinycolor2';
import { colore } from 'colore-js';
import { lighten } from 'colore-js/fn';
tinycolor('#2563eb').lighten(10).toHexString(); // '#5484ef'
colore('#2563eb').lighten(10).hex(); // '#3272fb'
lighten('#2563eb', 10); // '#3272fb'
The lighter blue differs because tinycolor2 does most of its math in HSL and Colore does it in OKLCH, where a change in lightness keeps the color's hue and chroma.
Method by method
All the Colore names in the middle column are exports of colore-js/fn except isDark and isLight, which are methods on the Color class.
Black or white text
mostReadable returns the candidate with the best WCAG 2 ratio. In Colore, isDark() makes the same choice between black and white, apart from colors right at the crossover point. The color it picks always reaches at least 4.58:1, which passes WCAG AA for normal text.
tinycolor.mostReadable('#3b82f6', ['#000000', '#ffffff']).toHexString(); // '#000000'
colore('#3b82f6').isDark() ? '#ffffff' : '#000000'; // '#000000'
bestTextColor('#3b82f6'); // '#ffffff'
bestTextColor picks by APCA, a newer contrast method that tinycolor2 doesn't have. It often picks white on saturated mid-tones like this blue, where WCAG 2 picks black. Across a grid of 4,096 background colors (16 levels per RGB channel), it picked differently from mostReadable on 1,151, about 28%. Black or white text compares the two methods on every Tailwind 500 shade.
isDark tells you which text color to use
tinycolor2 calls a color dark when its perceived brightness is under 128 out of 255. Colore calls it dark at a relative luminance of 0.179 or less, the point where white text starts to have more WCAG 2 contrast than black. The two cutoffs disagree on 627 of the same 4,096 colors, about 15%. If you switch text color on isDark(), those colors get a different text color after you move to Colore, and it's the one with more contrast.
What changes when you lighten
tinycolor2 adds points of HSL lightness. HSL lightness doesn't track what you see, so lighten(20) takes a different-size step on each color and lowers its chroma. Colore moves 20% of the way to white in OKLCH on every color, and keeps the hue and chroma.
On violet, blue and red, tinycolor2's lighter shade keeps less than half the chroma of the original, which is why it looks washed out. Colore's lighter violet is still the same violet, and it stays that way in hex: toHex(lighten('#8b5cf6', 20)) is #a276ff, with chroma 0.196 against tinycolor2's 0.088. Before you convert, Colore's functions write a color that's more vivid than sRGB as oklch() or color(display-p3 …), which current browsers render. When you need hex, call toHex, or .toGamut('srgb').hex() on the Color class to keep the hue closer. See Gamut and CSS output.
The same amount moves the color a different distance in each library, so don't copy the numbers across. Pick new amounts by eye, or replace hand-picked hover colors with generateStates.
When to switch
tinycolor2 is the smaller package, at 5.4 kB gzipped (bundlephobia). In Colore, toHex alone from colore-js/fn is about 10 KiB gzipped, because it brings the parser with it, and the Color class is about 18 KiB, measured with Rollup and Terser (details).
Switch when your app reads OKLCH or Display P3 colors, when you want lighter and darker shades that keep their color, or when you need contrast repair and theme generation, which tinycolor2 doesn't have.
If designers signed off on colors that tinycolor2 calculated, switching changes them. Generate both sets and compare before you replace stored values. To see the shades and theme Colore makes from your brand color, open it in the palette generator or the theme generator.