radix-ui / colors

A gorgeous, accessible color system.
https://www.radix-ui.com/colors
MIT License
1.38k stars 63 forks source link

Is there a way to generate the colors programatically? #47

Open mhmdjaw opened 2 months ago

mhmdjaw commented 2 months ago

In other words, instead of manually going to the custom colors tool and copying colors from there, generate them dynamically sort of like this:

import { generateLightAccent } from '@radix-ui/colors'

const lightAccentBlue = generateLightAccent('#3D63DD')

lightAccentBlue.light4
lightAccentBlue.lightA8

This would be such an awesome feature and would enable dynamic theme generation. I would really love to work on this, but I can't find the source code for the custom colors tool.

yan-yanishevsky commented 4 days ago

Found in other repo: https://github.com/radix-ui/website/blob/main/components/generateRadixColors.tsx