1 import type { Instance as Color } from 'tinycolor2';
2 import tinycolor from 'tinycolor2';
4 export function genPillTextColorShades(base: Color) {
5 const hsl = base.toHsl();
7 const lightBackground = tinycolor({
9 s: Math.min(1, hsl.s * 1.3),
13 const darkBackground = tinycolor({
15 s: Math.min(1, hsl.s * 1.05),
21 tinycolor.mostReadable(base, [lightBackground, darkBackground], {
22 includeFallbackColors: false,
29 export function genPillBackgroundColorShades(base: Color) {
30 const hsl = base.toHsl();
32 const lightText = tinycolor({
34 s: Math.min(1, hsl.s * 1.05),
38 const darkText = tinycolor({
45 tinycolor.mostReadable(base, [lightText, darkText], {
46 includeFallbackColors: false,