TaishoDS Core generates an accessible ten-step color scale from one brand color by assigning each step a target contrast against the page background, then finding an OKLCH lightness that meets it. The seed color is kept unchanged at the step closest to its existing contrast; chroma is limited and reduced toward the ends of the scale, and yellow hues rotate as they darken to avoid muddy olive shades. Light and dark palettes are calculated independently, and each step receives whichever system gray - light or dark - offers stronger text contrast. Tests across 4,096 starting colors produced 81,920 steps, with a minimum computed text contrast of 4.63:1, above WCAG AA’s 4.5:1 requirement. The author contrasts this approach with evenly spaced lightness values: tests found that this visually orderly method failed AA for some text in 45 of 648 colors, because equal OKLCH lightness does not mean equal luminance or contrast.
The method also aims to make a step number mean roughly the same contrast across hues, unlike fixed palettes whose colors can vary substantially in readability. It has limits: the checks cover text on each individual step, not every pairing of palette colors, and the color sweep does not cover every possible color or tinted gray theme. Some seed colors are shifted when they fall in a range where neither light nor dark text works reliably; the shift affected about one in ten tested scales. A recheck found that the current shifting rule can worsen contrast against the background, move colors that already pass, and misclassify borderline results when calculations use unrounded colors. Version 0.17 is planned to require both text and background contrast to pass, check borderline cases using screen-rounded values, and preserve a seed that meets both thresholds.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.