I would like to use the nice jQuery colorpicker (https://github.com/vanderlee/colorpicker) with CMYK colors.
To get the cmyk values from the dialog I use
colorFormat: ['EXACT', 'cp;mp;yp;kp'],
That results in something like this
0;68.157958984375;68.157958984375;20.1904296875
But when I open the colorpicker dialog again, the color is not determined.
It seems that the EXACT pattern is not used for reading.
You can test this with:
<!DOCTYPE html>
<html><head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="colorpicker/jquery.colorpicker.js"></script>
<link type="text/css" rel="stylesheet" href="colorpicker/jquery.colorpicker.css"></link>
</head>
<body>
<input type="text" class="cp-full" value="0;83.782958984375;83.782958984375;4.736328125" style="width:350px" />
<script>
$(function() {
$('.cp-full').colorpicker({
parts: ['map', 'bar', 'hex', 'rgb', 'alpha', 'cmyk', 'preview' ],
showOn: 'both',
colorFormat: ['EXACT', 'cp;mp;yp;kp'],
init: function(event, color) {
console.log(color);
},
});
});
</script>
</body>
So, how can I do that?
(I had a look at the object whent init is fired, but i assume that is to late. Maybe there is an earlier event to split the values from the field.)