Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to programmatically change the thumbnail color? #114

Closed
Turtleted21 opened this issue Jul 11, 2023 · 0 comments
Closed

How to programmatically change the thumbnail color? #114

Turtleted21 opened this issue Jul 11, 2023 · 0 comments

Comments

@Turtleted21
Copy link

Turtleted21 commented Jul 11, 2023

Hi
How to programmatically change the thumbnail color (without a click/pick event)?

I try this without success :

      Coloris({
        el: ".coloris",
        input: "#ff0000",
        wrap: true,
        // swatchesOnly: true,
        alpha: false,
        swatches: ["#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51", "#48cae4"],
      });

default with a empty value :
<input id="color-changer" type="text" class="coloris" value="" style="width: 25px; height: 25px; border-radius: 5px; box-sizing: border-box" />

try to change to pink :
document.getElementById("color-changer").dispatchEvent(new Event("input", { value: "#ff00ff" }));

or

document.getElementById("color-changer").value = "#ff00ff";

Thanks

Repository owner locked and limited conversation to collaborators Jul 11, 2023
@mdbassit mdbassit converted this issue into discussion #115 Jul 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant