pota/use/colorpota/use/color bundles a small palette of color helpers: a wrapper
over the browser EyeDropper API, a perceptually-uniform gradient
generator, APCA-based readability helpers, validation, and a
passthrough of the popular color-bits string helpers (alpha,
blend, darken, lighten, getLuminance).
eyeDropper(cb) — pick an sRGB color with
the browser EyeDropperscale(colors, count?) — OkLab-interpolated
gradient ramptextColor(color) — 'white' or 'black',
whichever reads bettertextColorWhenBackgroundIsBlack(color)
— lighten until readable on blacktextColorWhenBackgroundIsWhite(color)
— darken until readable on whitevalidateColor(string) — passthrough if
it parses, else undefinedThese are re-exported from color-bits so callers don't need to install it directly:
alpha(color, value) — set the alpha channelblend(background, overlay, opacity, gamma) —
alpha-composite an overlay over a backgrounddarken(color, value) — darken a colorlighten(color, value) — lighten a colorgetLuminance(color) — relative
luminance as a number