Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ansi): add hsl and rgb values #110

Merged
merged 2 commits into from
Nov 2, 2024
Merged

Conversation

sgoudham
Copy link
Contributor

@sgoudham sgoudham commented Nov 2, 2024

Should have probably done this in the initial release.

I've chosen to still use tinycolor2 but I'm wondering if it's better to use the new colorjs.io dependency here. It would be nice to move away from tinycolor2 to ensure that we're only using one colour library but I suppose it doesn't really hurt anyone if we decide to keep both.

Going forward, we should decide if we want to:

  1. Move away from tinycolor2 in favour of colorjs.io for all colour transformations. Unfortunately, moving away from tinycolor2 would mean a slight breaking change in the precision for HSL values so that's something to keep in mind, see example below:

    image

OR

  1. Keep tinycolor2 and colorjs.io but ensure that colorjs.io is only used for the LCH modifications as that is the only reason I brought it in (tinycolor2 doesn't support LCH modifications - Support for LCH? bgrins/TinyColor#237)

@sgoudham sgoudham force-pushed the feat/add-rgb-and-hsl-to-ansi branch from 9eb397d to dbda53c Compare November 2, 2024 09:14
@sgoudham
Copy link
Contributor Author

sgoudham commented Nov 2, 2024

At this moment in time, I'm gonna stick with 2. because tinycolor2 does a lot more work in the background to properly convert to RGB whereas colorjs.io gives me back the raw value between 0 an 1 instead of between 0 and 255.

These dependencies don't impact the end user so I think it's more than fine to keep them both.

@sgoudham sgoudham merged commit b669cdf into main Nov 2, 2024
1 check passed
@sgoudham sgoudham deleted the feat/add-rgb-and-hsl-to-ansi branch November 2, 2024 13:02
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.

1 participant