Skip to content

Commit

Permalink
Deploying to gh-pages from @ 4ea39c7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
meodai committed May 9, 2024
1 parent 2f35c57 commit f95acd9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,8 @@ <h2>Color Properties</h2>
harveyHue,
} from "./index.mjs";

import { rybHsl2rgb } from "https://esm.sh/rybitten/";

console.clear();

const $favicon = document.querySelector('link[rel="icon"]');
Expand Down Expand Up @@ -1587,7 +1589,7 @@ <h2>Color Properties</h2>

pane.addInput(PARAMS, 'Color Mode', {
options:
['hsl', 'okhsl', 'hsv', 'okhsv', 'hsi', 'hwb', 'lch', 'oklch']
['hsl', 'okhsl', 'hsv', 'okhsv', 'hsi', 'hwb', 'lch', 'oklch', 'RYBItten']
});

const createPalette = (hueList = null) => {
Expand Down Expand Up @@ -1703,18 +1705,25 @@ <h2>Color Properties</h2>
channels.c = s * 150;
channels.h = h;
css = colorToCSS([h, s, l], 'lch');
} else if (colorMode === 'RYBItten') {
const [ ry, gy, by ] = rybHsl2rgb([h, s, l]);
channels.r = ry;
channels.g = gy;
channels.b = by;
}

const computedColorMode = colorMode === 'RYBItten' ? 'rgb' : colorMode;

const { r, g, b } = culori.converter("rgb")({
mode: colorMode,
mode: computedColorMode,
...channels
});

return {
hsl: [h, s, l],
rgb: [r * 255, g * 255, b * 255],
hex: culori.formatHex({ mode: colorMode, ...channels }),
css: css || culori.formatHex({ mode: colorMode, ...channels }),
hex: culori.formatHex({ mode: computedColorMode, ...channels }),
css: css || culori.formatHex({ mode: computedColorMode, ...channels }),
contrast: {
white: culori.wcagContrast("#ffffff", { mode: 'hsl', ...channels }),
black: culori.wcagContrast("#000000", { mode: 'hsl', ...channels }),
Expand Down

0 comments on commit f95acd9

Please sign in to comment.