visgl / visgl/deck.gl

[Feat] CSS color support

Open
#8,019 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Target Use Case

The fillColor in deck.gl uses alpha values between 0 and 255 while W3C uses 0 and 1.
It would be great to use 0 and 1 since this is in use in CSS.

Also support for hex color strings #ffffff and rgbaString rgba(255, 255, 255, 1) as well as color name strings 'black' would be great.

https://www.w3schools.com/css/css_colors_rgb.asp

This would also ensure compatibility to librarys like colormap.

Proposal
let attributes = {
    getColor: 'black',
    getFillColor: 'rgb(100, 0, 0)',
}

or

let attributes = {
    getColor: '#000000',
    getFillColor: 'rgba(0, 100, 0, 0.5)',
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating deck.gl's handling of fillColor and getColor attributes, then compare the current accepted values with the CSS color forms listed in the issue. Done means the proposed hex, rgb/rgba, and named-color examples work while preserving the requested alpha behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.