Replies: 4 comments
-
I doubt that the UI could be updated to only show 256 colors for selection - as that would be some heavy redesign. But you could probably more easily add in some logic in the hook that fires after color selection that converts the chosen color to its nearest 256-color equivalent. No idea what that logic would be, but I’m sure it’s possible and out there on the web. |
Beta Was this translation helpful? Give feedback.
-
Thank you. This was what I had in mind if it wasn't possible, or add another Angular controller depending on the case, like this one: |
Beta Was this translation helpful? Give feedback.
-
Yes, I think the easiest way would be to round the color properties. Think of it like picker.on("change", function(color) {
var rgb = CP.HEX2RGB(color);
rgb[0] = colorRound(rgb[0]);
rgb[1] = colorRound(rgb[1]);
rgb[2] = colorRound(rgb[2]);
document.body.style.backgroundColor = 'rgb(' + rgb.join(', ') + ')';
});
function colorRound(i) {
// ...
} Then, optionally we can set custom background gradients for better visualization, with some technique that can convert smooth gradient into pixelated gradient: .color-picker-h { /* ... */ }
.color-picker-sv { /* ... */ } |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Hello,
Great work, well done!
Currently, your color-picker offers among 16 million colors. I would like to use it to control the color of a system that has only 256 colors. Is it possible to choose the number of colors to display?
Thank you.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Beta Was this translation helpful? Give feedback.
All reactions