Skip to content

Commit

Permalink
Deploying to gh-pages from @ 5465c1c 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
meodai committed Oct 13, 2024
1 parent d85b024 commit 94dbec7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions index.esm.js

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,11 @@ <h2>About</h2>
</aside>

<script src="https://cdn.jsdelivr.net/npm/@jaames/iro@5"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.1.1/chroma.min.js"></script>

<script src="./index.iife.js"></script>
<script>
<script type="module">
import { rgb, random, formatHex } from "https://cdn.skypack.dev/culori";

//import ColorDescription from './index.esm.js';
const cd = new ColorDescription.default("#b40404");
const $result = document.querySelector("[data-result]");
Expand Down Expand Up @@ -351,7 +353,7 @@ <h2>About</h2>
});

function setColor(e, fromPicker) {
const value = e ? e.target.value : chroma.random().hex();
const value = e ? e.target.value : formatHex(random());
cd.color = value;
$input.value = value;
const glPercentages = cd.percentageWords("rgb");
Expand Down Expand Up @@ -407,12 +409,9 @@ <h3>CMYK Mix</h3>
cmykPercentageWords[2]
} yellow and ${cmykPercentageWords[3]} black.</p>
<br />
<!--small data-label="HSL color representation">${chroma(value).css(
"hsl",
)}</small-->
`;
document.querySelector("[data-picker]").dataset.hsl =
chroma(value).css("hsl");
"" /*chroma(value).css("hsl")*/;
$currentColor.style.backgroundColor = value;
$currentColor.style.color = cd.bestContrast;

Expand All @@ -431,7 +430,7 @@ <h3>CMYK Mix</h3>
$input.addEventListener("input", setColor);

$randomButton.addEventListener("click", (e) => {
setColor({ target: { value: chroma.random().hex() } });
setColor({ target: { value: formatHex(random()) } });
});

document.documentElement.addEventListener("click", (e) => {
Expand Down
4 changes: 2 additions & 2 deletions index.iife.js

Large diffs are not rendered by default.

0 comments on commit 94dbec7

Please sign in to comment.