Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

Implements the toHsl() method that was throwing "not implemented" and changes the default color serialization from hex to HSL format.

Changes

  • Color.toHsl(): Converts RGB to HSL using existing rgbToHsl utility
    • Returns hsl(H, S%, L%) for opaque colors
    • Returns hsla(H, S%, L%, A%) for colors with alpha (consistent with toRgb()/rgba() pattern)
  • Color.toString(): Now returns HSL instead of hex

Example

const color = Color.from('#009edd');
color.toHsl();     // 'hsl(197, 100%, 43%)'
color.toHex();     // '#009edd' (still available)

const withAlpha = Color.fromValues(255, 0, 0, 128);
withAlpha.toHsl(); // 'hsla(0, 100%, 50%, 50%)'

Tests

Added Color.toHsl.test.ts covering primary colors, grayscale, custom colors, HSL roundtrip, and HSLA format.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • scarf.sh
    • Triggering command: /usr/local/bin/node node ./report.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>🎨 Use hsl</issue_title>
<issue_description>Use colors in hsl format (not rgb/hex/...)</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
promptbook-playground Error Error Nov 26, 2025 1:20am
promptbook-utils Ready Ready Preview Comment Nov 26, 2025 1:20am

Copilot AI changed the title [WIP] Update color usage to HSL format 🎨 Implement toHsl() and use HSL as default color format Nov 26, 2025
Copilot AI requested a review from hejny November 26, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🎨 Use hsl

2 participants