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

CMYK issues #64

Open
thednp opened this issue May 15, 2019 · 2 comments
Open

CMYK issues #64

thednp opened this issue May 15, 2019 · 2 comments

Comments

@thednp
Copy link

thednp commented May 15, 2019

This doesn't bother me very much, but if I ever get into a situation where I need CMYK to be used with my favorite colorPicker of all time, well....

Here's the thing: I set an input

<input class="colorpicker" data-colormode="cmyk" type="text" value="cmyk(15,25,30,40)">
var pickers = new jsColorPicker('input.colorpicker', {});

Issues:

  • my data-colormode attribute gets changed to cmy, weird
  • Everytime I click my input, the color gets brighter and changes all values in all color modes instead of just opening the current colorpicker instance.
@PitPik
Copy link
Owner

PitPik commented May 22, 2019

Hi @thednp The issue is not related to a bug but to wrong expectations. The initiator of colorPicker accepts color formats that are supported by the browser which are RGB, rgb, rgba, hsl and hsla. RGBA is also supported nowerdays, but I guess colorPicker doesn't (I have to look it up).

You might want to write an input that takes cmyc and convert it to rgb and feed a hidden input with the value so the hidden input triggers the colorPicker but it shows values from the cmyc input field.
If you wrap both inside a <label> tag, the click event will be transferred to the hidden input and the colorPicker should show.

Hope this helped.
Greetings.

@thednp
Copy link
Author

thednp commented May 22, 2019

Thanks for taking the time to reply.

I'm not using the colorpicker to use it's CMYK value as color for web elements, I know it's not supported, but I use it as a way for people to input a color in any format they have, perhaps some folk has come from print with CMYK values and wants to use those colors into web apps, converted to supported formats like rgb/hex or hsl in the near future.

I suggest you take a look, it won't take much.

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