Skip to content

Commit 0100a01

Browse files
committed
feat: add logColors function to enhance color logging in console
1 parent 4072cb4 commit 0100a01

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

dist/index.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,18 @@ <h2 class="subtitle support__title">Support</h2>
19501950
//.map((_, i) => `hsl(${i / (steps - 1) * 360}, calc(var(--s) * 100%), calc(var(--l,0) * 100%)) calc(${i / (steps - 1) * 100}% + 1px)`)
19511951
.map((_, i) => `hsl(${i / (steps - 1) * 360}, calc(var(--s) * 100%), calc(var(--l,0) * 100%))`)
19521952
.join(',');
1953+
1954+
const logColors = (colors, includeValue = false) => {
1955+
let o = "", s = [];
1956+
for (const c of colors) {
1957+
o += `%c ${includeValue ? c : ''} `;
1958+
s.push(`background:${c}; color:${c}`);
1959+
}
1960+
console.log(o, ...s);
1961+
if (!includeValue) {
1962+
console.log(colors);
1963+
}
1964+
};
19531965

19541966
const createSVG = (svgscale = 100) => {
19551967
const $svg = document.createElementNS(
@@ -2146,7 +2158,9 @@ <h2 class="subtitle support__title">Support</h2>
21462158

21472159
const colorsHEX = poline.colors.map(color => formatHex(
21482160
{ mode: currentHueModel, ...currentModelFn(color) }
2149-
))
2161+
));
2162+
2163+
logColors(colorsHEX);
21502164

21512165
fetch(`https://api.color.pizza/v1/?values=${
21522166
colorsHEX.map(c => c.replace('#', '')).join()

0 commit comments

Comments
 (0)