Replies: 7 comments
-
That's because the option const alwan = new Alwan('#colorpicker', {
preset: false
}); |
Beta Was this translation helpful? Give feedback.
-
Now the picker shows up after using the preset: flase. However, I don't know why it doesn't apply to Fabric js's text. But I try this picker Coloris it works. |
Beta Was this translation helpful? Give feedback.
-
You need to set the value of the input. Example: const input = document.getElementById('colorpicker');
alwan.on('color', e => {
input.value = e.rgb;
}); |
Beta Was this translation helpful? Give feedback.
-
Sorry, my misunderstanding. This one works for me. With or without preset: false, still work.
|
Beta Was this translation helpful? Give feedback.
-
You don't need an input, you can set the fill color directly from the color picker. alwan.on('color', e => {
canvas.getActiveObject().set("fill", e.rgb);
canvas.renderAll();
}); |
Beta Was this translation helpful? Give feedback.
-
But if have many Ids to apply, still need, right? |
Beta Was this translation helpful? Give feedback.
-
Depends on your code. |
Beta Was this translation helpful? Give feedback.
-
Hello, nice color picker, I'm new to it. Now I use
<input id="colorpicker" type="color">
for Fabric.js. I want to switch to your picker but it's not working for my case. Here is what I try.The input tag will then change to the button tag like this. This doesn't work with Fabric.js.
<button class="alwan__button alwan__preset-button" type="button" id="colorpicker" style="--alwan-color: rgb(173, 23, 23);"></button>
Beta Was this translation helpful? Give feedback.
All reactions