mirror of
https://github.com/PitPik/colorPicker.git
synced 2025-09-07 16:22:37 -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
|
||||
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...
|
||||
scale: 1, // only used internaly if size changes... (should't be here)
|
||||
allMixDetails: true, // see Colors...
|
||||
alphaBG: 'w' // initial 3rd layer bgColor (w = white, c = custom (customBG), b = black);
|
||||
customBG: '#808080' // see Colors...
|
||||
|
@ -66,7 +66,6 @@
|
||||
fps: 60, // 1000 / 60 = ~16.7ms
|
||||
delayOffset: 8,
|
||||
CSSPrefix: 'cp-',
|
||||
scale: 1,
|
||||
allMixDetails: true,
|
||||
alphaBG: 'w',
|
||||
imagePath: '',
|
||||
@ -197,6 +196,7 @@
|
||||
// We transfer the responsibility to the instance of Color (to save space and memory)
|
||||
delete THIS.options;
|
||||
_options = _colorInstance.options;
|
||||
_options.scale = 1;
|
||||
CSSPrefix = _options.CSSPrefix;
|
||||
|
||||
THIS.color = _colorInstance; // check this again...
|
||||
@ -838,7 +838,7 @@
|
||||
|
||||
function resizeApp(e, size) {
|
||||
var event = e || window.event,
|
||||
page = getPageXY(event),
|
||||
page = event ? getPageXY(event) : {},
|
||||
isSize = size !== undefined,
|
||||
x = isSize ? size : page.X - _targetOrigin.left + 8,
|
||||
y = isSize ? size : page.Y - _targetOrigin.top + 8,
|
||||
|
2
index.js
2
index.js
@ -423,7 +423,7 @@
|
||||
renderCallback = doRender,
|
||||
// finally the instance of either ColorPicker or Colors (export for debugging purposes)
|
||||
color_ColorPicker = new (ColorPicker || Colors)({
|
||||
customBG: '#808080'
|
||||
customBG: '#808080',
|
||||
// renderCallback: renderCallback, // doesn't work in Colors, but also doesn't matter
|
||||
// convertCallback: function(color, type){console.log(color, type)}
|
||||
// resizeCallback: function(e, value, scale, original){console.log(e, value, scale, original)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user