GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Convert CSS color specifiers to rgba in gl traces by camdecoster · Pull Request #8119 · plotly/plotly.js

Conversation

@camdecoster

@camdecoster camdecoster commented Oct 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description

Convert CSS color specifiers to rgba before passing them to regl libraries to avoid issues with syntax compatibility.

Closes #8116.

Changes

  • Convert color specifiers
  • Add tests

Screenshots

Before After
image image

Testing

  • Be on main
  • Open Plotly devtools and paste the following into the browser devtools console:
    const c = 'oklch(0.7 0.15 30)';
    const trace = {
        x: [1, 2, 3], y: [1, 3, 2], mode: 'lines+text', text: ['a', 'b', 'c'], textposition: 'top center',
        line: { color: c, width: 4 }, fill: 'tozeroy', fillcolor: c, textfont: { color: c, size: 20 },
        error_y: { array: [0.5, 0.5, 0.5], color: c, thickness: 3 }
    };
    Plotly.newPlot(gd, [
        { ...trace, type: 'scatter', name: 'scatter' },
        { ...trace, type: 'scattergl', name: 'scattergl', xaxis: 'x2', yaxis: 'y2' }
    ], { grid: { rows: 1, columns: 2, pattern: 'independent' }, width: 800, height: 400 });
  • Note that the scattergl trace has the incorrect color
  • Switch to this branch
  • Run the snippet again
  • Note that the scattergl trace has the correct color

Notes

  • The underlying regl libraries that these traces use rely on an older color parsing library that doesn't parse modern CSS color specifiers (color-normalize v1.5.2)
  • plotly.js already has the feature to convert modern specifiers to rgba, so I did that here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
camdecoster added 3 commits October 13, 2026 19:50
@camdecoster
fix: Convert CSS color specifiers to rgba in gl traces
00521de
@camdecoster
Add tests
f331ecf
@camdecoster
Add draftlog
333aba0
@camdecoster
camdecoster marked this pull request as ready for review October 14, 2026 12:44
@camdecoster camdecoster assigned KoolADE85 Oct 14, 2026
KoolADE85
KoolADE85 approved these changes Oct 14, 2026
View reviewed changes

@KoolADE85 KoolADE85 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good here! 💃

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@camdecoster
camdecoster merged commit eff4574 into main Oct 14, 2026
328 of 337 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@camdecoster
camdecoster deleted the cam/8116/convert-css-specifiers-rgba-gl-traces branch October 14, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@KoolADE85 KoolADE85 KoolADE85 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@KoolADE85 KoolADE85

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG]: scattergl renders line.color, fillcolor, error_x.color, error_y.color, and textfont.color incorrectly with modern CSS color spaces

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@camdecoster @KoolADE85
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.