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
feat(NcColorPicker): palette now can have color names #4611
Conversation
- Convert ES5 function constructor to ES2015 class - Fix JSDoc tyles - Use `Math.floor(number)` instead of `parseInt(string)` to convert float number to integer Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
2058a9c
to
baef643
Compare
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
baef643
to
d203fb1
Compare
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
d5ff44f
to
c7c62e0
Compare
Works but we should label the default palette in a follow up |
The problem is that it is generated... Have no idea how to combine generation and naming, except having a list of 1000 color names and search for the nearest :D |
But it is not exported and only used in two places, both generate a palette of 6 colors (-> 18 colors total). |
Agree. I'll do it in follow-ups next week:
|
☑️ Resolves
Now
palette
can optionally be not only an array of string['#fff', '#000']
, but also an array or colors with names[{ color: '#000', name: 'black' }, { color: '#fff', name: 'white' }]
.Buttons in the picker have value with a name or a fallback
'A color with a HEX value {hex}'
.Also, a11y fix: now the palette is not a set of independent buttons but a radio button group.
🖼️ Screenshots
🏁 Checklist