We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 614929a commit 3aed42aCopy full SHA for 3aed42a
modules/colors.html
@@ -179,14 +179,14 @@
179
function createHWB(h, s, l, opacity) {
180
const cell = document.querySelector("#HWB td");
181
const hsv = (s * ((l < 50) ? l : 100 - l)) / 100;
182
- const W = (hsv === 0) ? 0 : ((2 * hsv) / (l + hsv)) * 100;
183
- const B = l + hsv;
+ let W = (hsv === 0) ? 0 : ((2 * hsv) / (l + hsv)) * 100;
+ let B = l + hsv;
184
+ W = W.toFixed(1);
185
+ B = B.toFixed(1);
186
if (opacity === 1) {
- cell.textContent = `hwb(${h} ${W.toFixed(1)}% ${B.toFixed(1)}%)`;
187
+ cell.textContent = `hwb(${h} ${W}% ${B}%)`;
188
} else {
- cell.textContent = `hwb(${h} ${W.toFixed(1)}% ${B.toFixed(
- 1
189
- )}% / ${opacity})`;
+ cell.textContent = `hwb(${h} ${W}% ${B}% / ${opacity})`;
190
}
191
192
0 commit comments