|
|
@ -87,7 +87,7 @@
|
|
|
|
find('.cp-alpha').toggle(!!_options.opacity).
|
|
|
|
find('.cp-alpha').toggle(!!_options.opacity).
|
|
|
|
parent(). // back to $(_html)
|
|
|
|
parent(). // back to $(_html)
|
|
|
|
show(0, function() {
|
|
|
|
show(0, function() {
|
|
|
|
_GPU = _options.GPU && $(this).css('transform') === '';
|
|
|
|
_GPU = _options.GPU && $(this).css('perspective') === '';
|
|
|
|
_options.buidCallback.call(_colorPicker, $(this));
|
|
|
|
_options.buidCallback.call(_colorPicker, $(this));
|
|
|
|
_$xy_slider = $('.cp-xy-slider', this);
|
|
|
|
_$xy_slider = $('.cp-xy-slider', this);
|
|
|
|
_$xy_cursor = $('.cp-xy-cursor', this);
|
|
|
|
_$xy_cursor = $('.cp-xy-cursor', this);
|
|
|
@ -174,29 +174,52 @@
|
|
|
|
hueRGB.r + ',' + hueRGB.g + ',' + hueRGB.b + ')'});
|
|
|
|
hueRGB.r + ',' + hueRGB.g + ',' + hueRGB.b + ')'});
|
|
|
|
_$xy_cursor.css({
|
|
|
|
_$xy_cursor.css({
|
|
|
|
transform: t3d + '(' + s + 'px, ' + v + 'px, 0)',
|
|
|
|
transform: t3d + '(' + s + 'px, ' + v + 'px, 0)',
|
|
|
|
left: !_GPU ? s : '',
|
|
|
|
left: !_GPU ? s : 0,
|
|
|
|
top: !_GPU ? v : '',
|
|
|
|
top: !_GPU ? v : 0,
|
|
|
|
borderColor : colors.RGBLuminance > 0.22 ? dark : light
|
|
|
|
borderColor : colors.RGBLuminance > 0.22 ? dark : light
|
|
|
|
});
|
|
|
|
});
|
|
|
|
_$z_cursor.css({
|
|
|
|
_$z_cursor.css({
|
|
|
|
transform: t3d + '(0, ' + h + 'px, 0)',
|
|
|
|
transform: t3d + '(0, ' + h + 'px, 0)',
|
|
|
|
top: !_GPU ? h : '',
|
|
|
|
top: !_GPU ? h : 0,
|
|
|
|
borderLeftColor : HUEContrast,
|
|
|
|
borderColor : 'transparent ' + HUEContrast,
|
|
|
|
borderRightColor : HUEContrast
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
_$alpha.css({backgroundColor: 'rgb(' + RGBInnerText + ')'});
|
|
|
|
_$alpha.css({backgroundColor: 'rgb(' + RGBInnerText + ')'});
|
|
|
|
_$alpha_cursor.css({
|
|
|
|
_$alpha_cursor.css({
|
|
|
|
transform: t3d + '(' + a + 'px, 0, 0)',
|
|
|
|
transform: t3d + '(' + a + 'px, 0, 0)',
|
|
|
|
left: !_GPU ? a : '',
|
|
|
|
left: !_GPU ? a : 0,
|
|
|
|
borderTopColor : alphaContrast,
|
|
|
|
borderColor : alphaContrast + ' transparent'
|
|
|
|
borderBottomColor : alphaContrast
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
_options.doRender && _cache.$element.css({
|
|
|
|
_options.doRender && _cache.$element.css({
|
|
|
|
backgroundColor : RGBAText,
|
|
|
|
backgroundColor : RGBAText,
|
|
|
|
color: colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light
|
|
|
|
color: colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_cache.$element.val(text);
|
|
|
|
_cache.$element.val(text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// faster version (more than 2.5x)... though, no jQuery (colors, ...)
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// _$xy_slider[0].style.cssText =
|
|
|
|
|
|
|
|
// 'background-color:' + 'rgb(' +
|
|
|
|
|
|
|
|
// hueRGB.r + ',' + hueRGB.g + ',' + hueRGB.b + ');';
|
|
|
|
|
|
|
|
// _$xy_cursor[0].style.cssText =
|
|
|
|
|
|
|
|
// 'transform:' + t3d + '(' + s + 'px, ' + v + 'px, 0);' +
|
|
|
|
|
|
|
|
// 'left:' + (!_GPU ? s : 0) + 'px;' +
|
|
|
|
|
|
|
|
// 'top:' + (!_GPU ? v : 0) + 'px;' +
|
|
|
|
|
|
|
|
// 'border-color:' + (colors.RGBLuminance > 0.22 ? dark : light);
|
|
|
|
|
|
|
|
// _$z_cursor[0].style.cssText =
|
|
|
|
|
|
|
|
// 'transform:' + t3d + '(0, ' + h + 'px, 0);' +
|
|
|
|
|
|
|
|
// 'top:' + (!_GPU ? h : 0) + 'px;' +
|
|
|
|
|
|
|
|
// 'border-color:' + 'transparent ' + HUEContrast;
|
|
|
|
|
|
|
|
// _$alpha[0].style.cssText = 'background-color:' + 'rgb(' + RGBInnerText + ')';
|
|
|
|
|
|
|
|
// _$alpha_cursor[0].style.cssText =
|
|
|
|
|
|
|
|
// 'transform:' + t3d + '(' + a + 'px, 0, 0);' +
|
|
|
|
|
|
|
|
// 'left:' + (!_GPU ? a : 0) + 'px;' +
|
|
|
|
|
|
|
|
// 'border-color:' + alphaContrast + ' transparent';
|
|
|
|
|
|
|
|
// _options.doRender && (_cache.$element[0].style.cssText =
|
|
|
|
|
|
|
|
// 'background-color:' + RGBAText +
|
|
|
|
|
|
|
|
// ';color:' + (colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light));
|
|
|
|
|
|
|
|
// _cache.$element[0].value = text;
|
|
|
|
|
|
|
|
|
|
|
|
_options.renderCallback.call(
|
|
|
|
_options.renderCallback.call(
|
|
|
|
_colorPicker, _cache.$element, toggled === true);
|
|
|
|
_colorPicker, _cache.$element, toggled === true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|