Skip to content

Commit bfa445a

Browse files
committed
account for NaN
1 parent 32d0c79 commit bfa445a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sites/postcss-preset-env/src/static/js/blog_relative_color_syntax_channel_values_2024_03_02.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ function renderResult() {
257257
outputColorValue.channels = outputColorValue.channels.map((channel) => channel * 255);
258258
}
259259

260+
outputColorValue.channels = outputColorValue.channels.map((channel) => Number.isNaN(channel) ? 0 : channel);
261+
260262
outputChannel1Output.value = round(outputColorValue.channels[0]);
261263
outputChannel2Output.value = round(outputColorValue.channels[1]);
262264
outputChannel3Output.value = round(outputColorValue.channels[2]);

0 commit comments

Comments
 (0)