alexeyraspopov/picocolors

Add API to manually change color mode

ai opened this issue · 1 comments

ai commented

PostCSS, Logux Server and some other Nano Colors users have own options to change colors.

Can we have a way to manually change support mode like:

import { createColor } from 'picocolors'

let { red } = createColor(options.color)

Or:

import { setColors, isColorSupported } from 'picocolors'

setColors(options.color ?? isColorSupported)

In #22 I've implemented a similar to nanocolors and colorette approach, though some input needed since I'm not entirely convinced about the proper use case for this feature. Once review is done, we can definitely ship another version.