mirror of
https://github.com/PitPik/tinyColorPicker
synced 2025-06-29 22:21:05 -06:00
GPU detection fix
This commit is contained in:
parent
167c422c5e
commit
fd16aa9d7f
@ -112,7 +112,7 @@
|
|||||||
'box-sizing': 'border-box'}).
|
'box-sizing': 'border-box'}).
|
||||||
appendTo('body').
|
appendTo('body').
|
||||||
show(0, function() {
|
show(0, function() {
|
||||||
_GPU = _options.GPU && $(this).css('perspective') === '';
|
_GPU = _options.GPU && $(this).css('perspective') !== undefined;
|
||||||
_$xy_slider = $('.cp-xy-slider', this);
|
_$xy_slider = $('.cp-xy-slider', this);
|
||||||
_$xy_cursor = $('.cp-xy-cursor', this);
|
_$xy_cursor = $('.cp-xy-cursor', this);
|
||||||
_$z_cursor = $('.cp-z-cursor', this);
|
_$z_cursor = $('.cp-z-cursor', this);
|
||||||
@ -123,8 +123,7 @@
|
|||||||
this._height = this.offsetHeight;
|
this._height = this.offsetHeight;
|
||||||
}).hide().
|
}).hide().
|
||||||
on('touchstart mousedown pointerdown',
|
on('touchstart mousedown pointerdown',
|
||||||
'.cp-xy-slider,.cp-z-slider,.cp-alpha', pointerdown)
|
'.cp-xy-slider,.cp-z-slider,.cp-alpha', pointerdown);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function pointerdown(e) {
|
function pointerdown(e) {
|
||||||
@ -195,25 +194,25 @@
|
|||||||
s = colors.hsv.s * _$xy_slider._width,
|
s = colors.hsv.s * _$xy_slider._width,
|
||||||
v = (1 - colors.hsv.v) * _$xy_slider._height,
|
v = (1 - colors.hsv.v) * _$xy_slider._height,
|
||||||
a = alpha * _$alpha._width,
|
a = alpha * _$alpha._width,
|
||||||
t3d = _GPU ? 'translate3d' : '';
|
translate3d = _GPU ? 'translate3d' : '';
|
||||||
|
|
||||||
_$xy_slider._css = {
|
_$xy_slider._css = {
|
||||||
backgroundColor: 'rgb(' +
|
backgroundColor: 'rgb(' +
|
||||||
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: translate3d + '(' + s + 'px, ' + v + 'px, 0)',
|
||||||
left: !_GPU ? s : '',
|
left: !_GPU ? s : '',
|
||||||
top: !_GPU ? v : '',
|
top: !_GPU ? v : '',
|
||||||
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: translate3d + '(0, ' + h + 'px, 0)',
|
||||||
top: !_GPU ? h : '',
|
top: !_GPU ? h : '',
|
||||||
borderColor : 'transparent ' + HUEContrast
|
borderColor : 'transparent ' + HUEContrast
|
||||||
};
|
};
|
||||||
_$alpha._css = {backgroundColor: 'rgb(' + RGBInnerText + ')'};
|
_$alpha._css = {backgroundColor: 'rgb(' + RGBInnerText + ')'};
|
||||||
_$alpha_cursor._css = {
|
_$alpha_cursor._css = {
|
||||||
transform: t3d + '(' + a + 'px, 0, 0)',
|
transform: translate3d + '(' + a + 'px, 0, 0)',
|
||||||
left: !_GPU ? a : '',
|
left: !_GPU ? a : '',
|
||||||
borderColor : alphaContrast + ' transparent'
|
borderColor : alphaContrast + ' transparent'
|
||||||
};
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
2
jqColorPicker.min.js
vendored
2
jqColorPicker.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user