You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to set the initial background color for a CanvasSpace via Pts.quickstart, I created a Color variable using Color.hsl(268, 0.37, 0.51), which should be purple. However, the color is a vivid red. When logging the value of the color to console, it shows as hsl(127,84,176,1).
Am I misunderstanding how the hsl factory function works? The documentation seems pretty clear on the expected values, but the internal value does not match the expected.
The text was updated successfully, but these errors were encountered:
(function() {
// This should be purple
let bgColor = Color.hsl(268, 0.37, 0.51);
// Creating the same color as RGB works
// let bgColor = Color.rgb(127, 84, 176);
// It also works if you convert to rgb
// let bgColor = Color.hsl(268, 0.37, 0.51).toMode('rgb', true);
let strokeColor = Color.fromHex("FFFFFF");
console.table(bgColor.toString(), strokeColor.toString());
let run = Pts.quickStart( "#pt", bgColor );
let pts;
let count = parseInt(window.innerWidth * 0.2);
run( (time, ftime) => {
if (!pts) pts = Create.distributeRandom( space.innerBound, count );
let t = space.pointer;
pts.sort( (a,b) => a.$subtract(t).magnitudeSq() - b.$subtract(t).magnitudeSq() );
form.strokeOnly(strokeColor, 1);
pts.forEach( (p, i) => form.point( p, 20 - 20*i/pts.length, "circle" ) )
});
//// ----
space.bindMouse().bindTouch().play();
When trying to set the initial background color for a CanvasSpace via Pts.quickstart, I created a Color variable using Color.hsl(268, 0.37, 0.51), which should be purple. However, the color is a vivid red. When logging the value of the color to console, it shows as hsl(127,84,176,1).
Am I misunderstanding how the hsl factory function works? The documentation seems pretty clear on the expected values, but the internal value does not match the expected.
The text was updated successfully, but these errors were encountered: