-
Notifications
You must be signed in to change notification settings - Fork 839
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
Fix #2804: Use chroma-js for all color parsing and conversion #8000
base: main
Are you sure you want to change the base?
Conversation
💚 CLA has been signed |
👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually? |
👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually? |
Thanks for your contribution, @f3rnando0! Before we review it, we need to consider potential performance implications this may cause. Chroma.js is pretty slow when converting certain color formats, resulting in highly increased emotion style function evaluations. I've experienced ~3ms conversion times running on M2 Pro that I consider the top end of our users' CPUs. Since the styles need to be computed before the initial component render, this delay blocks components from being rendered "immediately" (let's forget about the react scheduler for the sake of this conversation), and due to the synchronous nature of how Emotion styles are being loaded, child components' functions can only be executed once Chroma finishes its calculations risking creating a cascading effect when used in multiple nested components. |
Summary
Refactered color parsing and conversion functions to use chroma-js methods as described in the issue #2804.
General checklist