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

Replace better-color-tools with culori #61

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Conversation

drwpow
Copy link
Collaborator

@drwpow drwpow commented Jul 28, 2023

See note. Culori is a better color science option, but more importantly, is more performant.

Technically this increases the footprint of Cobalt by a few kB, but it’s still pretty stinkin’ small. And this runs in Node, so footprint isn’t nearly as much of a concern as production frontend code.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 28, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2b551c2
Status: ✅  Deploy successful!
Preview URL: https://fdc43dff.cobalt-ui.pages.dev
Branch Preview URL: https://replace-better-color-tools.cobalt-ui.pages.dev

View logs

@changeset-bot
Copy link

changeset-bot bot commented Jul 28, 2023

🦋 Changeset detected

Latest commit: 2b551c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@cobalt-ui/plugin-css Patch
@cobalt-ui/core Patch
@cobalt-ui/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@drwpow drwpow force-pushed the replace-better-color-tools branch 3 times, most recently from d9209b2 to 04b012f Compare July 28, 2023 03:50
@drwpow drwpow force-pushed the replace-better-color-tools branch from 04b012f to 2b551c2 Compare July 28, 2023 03:50
@@ -22,17 +22,17 @@

@supports (color: color(display-p3 1 1 1)) {
:root {
--ds-color-gray: color(display-p3 0.329412 0.278431 0.254902);
--ds-border: 1px solid color(display-p3 0.05098 0.011765 0);
--ds-color-gray: color(display-p3 0.32941176470588235 0.2784313725490196 0.2549019607843137);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I guess all the rounding I was doing was slowing my library down for no good reason

--ds-color-blue: color(display-p3 0.129412 0.545098 1);
--ds-gradient: color(display-p3 0.129412 0.545098 1) 0%, color(display-p3 0.909804 0.352941 0.678431) 100%;
--ds-color-blue: color(display-p3 0.12941176470588237 0.5450980392156862 1);
--ds-gradient: color(display-p3 0.12941176470588237 0.5450980392156862 1) 0%, color(display-p3 0.9098039215686274 0.35294117647058826 0.6784313725490196) 100%;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I’m glad I maintained my own color science library for a bit. If no other reason than to be sure the colors were accurate. With thousands of ways to do things in culori, it’s so easy to produce the wrong colors when upconverting to P3, and it would take a while to realize it.

@drwpow drwpow merged commit 949481f into main Jul 28, 2023
5 checks passed
@drwpow drwpow deleted the replace-better-color-tools branch July 28, 2023 03:53
@github-actions github-actions bot mentioned this pull request Jul 28, 2023
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