8000 Allow to change swatches for Sketch component · Issue #177 · uiwjs/react-color · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow to change swatches for Sketch component #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sjoerd222888 opened this issue May 5, 2025 · 1 comment
Open

Allow to change swatches for Sketch component #177

sjoerd222888 opened this issue May 5, 2025 · 1 comment

Comments

@sjoerd222888
Copy link

I would like to be able to change the color swatches shown in the Sketch components. But as far as I can see there is not property to achieve this.

Working with brand colors I would like the user to freely select colors but at the same time also having brand colors available as swatches. The sketch component looks excellent for that case, but it seem I am not able to change the swatch color.

Any advise? Would this be a feature request?

@jaywcjlove
Copy link
Member

@sjoerd222888 Yes, you can customize the color swatches in the Sketch component by using the presetColors prop. Just pass an array of color values to presetColors, and they will appear as the swatches.

presetColors = PRESET_COLORS,

colors={presetColors}

const PRESET_COLORS = [
'#D0021B',
'#F5A623',
'#f8e61b',
'#8B572A',
'#7ED321',
'#417505',
'#BD10E0',
'#9013FE',
'#4A90E2',
'#50E3C2',
'#B8E986',
'#000000',
'#4A4A4A',
'#9B9B9B',
'#FFFFFF',
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0