Comments (7)
Hi @Isg90 ,
you probably don't need the implementation part (so, don't use jsColorPicker.min.js). You can use colorPicker.js by its own. Just instantiate (colorPicker = new ColorPicker();) and then use colorPicker.nodes.colorPicker (which is the "div" of colorPicker) and append it to where you want it to be: document.body.appendChild(colorPicker.nodes.colorPicker);
Let me know if this helps and if this is what you need..
Cheers
from colorpicker.
in jsColor
window.jsColorPicker = function(selectors, config) {
....
return window.jsColorPicker.colorPickers;
}
but window.jsColorPicker.colorPickers - is empty array.
How initialize colorPicker into some variable after constructing?
var colorPicker = jsColorPicker('input#' + elementId, {
customBG: '#222',
readOnly: true,
init: function(elm, colors) {
.......
}
}
from colorpicker.
Thank you. I will try your way. But can i make small changes in jsColor.js for returning colorPicker instance when appending color picker to input element? I use the same functionality of jsColor.js. But need to call setColor method later (after creation colorPicker by jsColor.js)
from colorpicker.
mb new listener in doEventListeners{} block? wich can call from javascript?
from colorpicker.
i adapted for my need. With this js when call jsColorPicker function creates ColorPicker instance. But need jquery (lazy to translate into clear js). Every created instance has own memoryColors and others.
Instance may be created like:
var color1 = jsColorPicker('input#' + elementId, { readOnly: true, // patch: false, init: function(elm, colors) { // colors is a different instance (not connected to colorPicker) elm.style.width = elementSide + 'px'; elm.style.height = elementSide - 2 + 'px'; elm.style.display = 'inline-block'; elm.style.border = '0px'; elm.style.borderRadius = elementSide/5 + 'px'; elm.style.display = 'block'; elm.style.background = cpbgc; elm.style.backgroundImage = 'url(select.png)'; elm.style.backgroundRepeat = 'no-repeat'; elm.style.backgroundSize = 'contain'; // elm.style.backgroundColor = elm.value; // elm.style.color = colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd'; }, noAlpha: true, noResize: true, memoryColors: "'rgba(82,80,151,1)','rgba(100,200,10,1)','rgba(100,0,0,1)','rgba(0,0,0,1)'", //appendTo: document.querySelector('input') });
from colorpicker.
What about of add an option "target", and an option "onClick", if target is selected, will be used to control the colorpicked activation, if onClick is set instead of handled the focus will be handled the moused down to active the color picked. It will be interesting to implement a general picker. Also one with bootstrap support. All this of-course to not need to change the code.
from colorpicker.
Maybe better a "mouseTarget" and a "focusTarget", to handled both type of events at the same time.
from colorpicker.
Related Issues (20)
- Unable to add letters to hex code if hex starts with 0
- potential failures with "document"
- WebGL support idea
- Plugin crashes when js files are called from html's head tag instead of body HOT 2
- 8 Digit Hex Code
- Reset all pickers with a single button click [jQuery version]
- Gradients Suggestion HOT 2
- Android web views and Chrome bad rendering HOT 1
- How to access colorPicker object? HOT 1
- positionCallback
- allMixDetails: false not working
- Picking color from L*a*b parameters HOT 2
- Color is not changing when colorpicker windows is opened and color defined programmatically
- active dev? HOT 1
- CMYK issues HOT 2
- How i can change the color of a div ?
- Integrate with Angular 8 project
- Can't get color-picker to open from input field
- Add to comfyUI manager?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorpicker.