mirror of
https://github.com/PitPik/colorPicker.git
synced 2025-09-09 01:02:36 -06:00
Fixed size/scale option
This commit is contained in:
parent
b37a93479e
commit
17e1a232d5
@ -35,7 +35,6 @@ var myColorPicker = new ColorPicker({
|
|||||||
delayOffset: 8, // pixels offset when shifting mouse up/down inside input fields before it starts acting as slider
|
delayOffset: 8, // pixels offset when shifting mouse up/down inside input fields before it starts acting as slider
|
||||||
CSSPrefix: 'cp-', // the standard prefix for (almost) all class declarations (HTML, CSS)
|
CSSPrefix: 'cp-', // the standard prefix for (almost) all class declarations (HTML, CSS)
|
||||||
size: 0, // one of the 4 sizes: 0 = L (large), 1 = S, 2 = XS, 3 = XXS; resize to see what happens...
|
size: 0, // one of the 4 sizes: 0 = L (large), 1 = S, 2 = XS, 3 = XXS; resize to see what happens...
|
||||||
scale: 1, // only used internaly if size changes... (should't be here)
|
|
||||||
allMixDetails: true, // see Colors...
|
allMixDetails: true, // see Colors...
|
||||||
alphaBG: 'w' // initial 3rd layer bgColor (w = white, c = custom (customBG), b = black);
|
alphaBG: 'w' // initial 3rd layer bgColor (w = white, c = custom (customBG), b = black);
|
||||||
customBG: '#808080' // see Colors...
|
customBG: '#808080' // see Colors...
|
||||||
|
@ -66,7 +66,6 @@
|
|||||||
fps: 60, // 1000 / 60 = ~16.7ms
|
fps: 60, // 1000 / 60 = ~16.7ms
|
||||||
delayOffset: 8,
|
delayOffset: 8,
|
||||||
CSSPrefix: 'cp-',
|
CSSPrefix: 'cp-',
|
||||||
scale: 1,
|
|
||||||
allMixDetails: true,
|
allMixDetails: true,
|
||||||
alphaBG: 'w',
|
alphaBG: 'w',
|
||||||
imagePath: '',
|
imagePath: '',
|
||||||
@ -197,6 +196,7 @@
|
|||||||
// We transfer the responsibility to the instance of Color (to save space and memory)
|
// We transfer the responsibility to the instance of Color (to save space and memory)
|
||||||
delete THIS.options;
|
delete THIS.options;
|
||||||
_options = _colorInstance.options;
|
_options = _colorInstance.options;
|
||||||
|
_options.scale = 1;
|
||||||
CSSPrefix = _options.CSSPrefix;
|
CSSPrefix = _options.CSSPrefix;
|
||||||
|
|
||||||
THIS.color = _colorInstance; // check this again...
|
THIS.color = _colorInstance; // check this again...
|
||||||
@ -838,7 +838,7 @@
|
|||||||
|
|
||||||
function resizeApp(e, size) {
|
function resizeApp(e, size) {
|
||||||
var event = e || window.event,
|
var event = e || window.event,
|
||||||
page = getPageXY(event),
|
page = event ? getPageXY(event) : {},
|
||||||
isSize = size !== undefined,
|
isSize = size !== undefined,
|
||||||
x = isSize ? size : page.X - _targetOrigin.left + 8,
|
x = isSize ? size : page.X - _targetOrigin.left + 8,
|
||||||
y = isSize ? size : page.Y - _targetOrigin.top + 8,
|
y = isSize ? size : page.Y - _targetOrigin.top + 8,
|
||||||
|
2
index.js
2
index.js
@ -423,7 +423,7 @@
|
|||||||
renderCallback = doRender,
|
renderCallback = doRender,
|
||||||
// finally the instance of either ColorPicker or Colors (export for debugging purposes)
|
// finally the instance of either ColorPicker or Colors (export for debugging purposes)
|
||||||
color_ColorPicker = new (ColorPicker || Colors)({
|
color_ColorPicker = new (ColorPicker || Colors)({
|
||||||
customBG: '#808080'
|
customBG: '#808080',
|
||||||
// renderCallback: renderCallback, // doesn't work in Colors, but also doesn't matter
|
// renderCallback: renderCallback, // doesn't work in Colors, but also doesn't matter
|
||||||
// convertCallback: function(color, type){console.log(color, type)}
|
// convertCallback: function(color, type){console.log(color, type)}
|
||||||
// resizeCallback: function(e, value, scale, original){console.log(e, value, scale, original)}
|
// resizeCallback: function(e, value, scale, original){console.log(e, value, scale, original)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user