Skip to content
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

Color picker does no longer accept shortened RGB values #6109

Open
christianlupus opened this issue Sep 21, 2024 · 1 comment
Open

Color picker does no longer accept shortened RGB values #6109

christianlupus opened this issue Sep 21, 2024 · 1 comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working feature: colorpicker Related to the colorpicker component

Comments

@christianlupus
Copy link
Contributor

The color picker component NcColorPicker does no longer accept colors in the shortened format (like #ABC for #AABBCC) as colors for the color palette. This due to the implementation in hexToRGB that assumes a format with 6 digits.

This should either be fixed or the documentation should clearly state that only full hex RGB values are allowed.

@Antreesy
Copy link
Contributor

Should work in theory from upstream library, but it's not:
https://github.com/xiaokaike/vue-color/blob/b0d364ff63957ee5253e42d270663c537631337e/src/components/Chrome.vue#L138-L142
https://github.com/xiaokaike/vue-color/blob/b0d364ff63957ee5253e42d270663c537631337e/src/mixin/color.js#L88-L90

Since support of this library seems to be discontinued, I'd rather proceed with proposal to migrate to native solution: #6096

Native color pickers seems to accept shortened HEX colors, so it will be automatically resolved: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#providing_a_default_color

@Antreesy Antreesy added bug Something isn't working 1. to develop Accepted and waiting to be taken care of feature: colorpicker Related to the colorpicker component labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working feature: colorpicker Related to the colorpicker component
Projects
None yet
Development

No branches or pull requests

2 participants