visgl / visgl/deck.gl

[Feat] Improving the getColor method in IconLayer

Open
#9,633 2 comments 0 reactions 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

Current getColor implementation with mask:true has critical limitations:

  1. Only works with binary masks - completely replaces all non-transparent pixels with solid color
  2. Destroys image details - cannot preserve:
    • Multi-tone icons (e.g. logos with shadows)
    • Built-in color schemes
  3. Performance overhead - requires generating separate atlases for each color variation
Proposal

Introduce alternative color blending via tint mode when mask:false:

new IconLayer({
  getColor: d => [r, g, b, a], // Applies as tint color
  iconMapping: {
    customIcon: {
      mask: false, // Enables tint blending
      // Original colors are preserved but blended with tint
    }
  }
});
tint Mode vs Current mask:true
Feature mask:true (Current) Proposed tint Mode
Detail Preservation ❌ Flat single-color ✅ Original colors + tint blend
Dynamic Updates ❌ Requires atlas rebuild ✅ Instant color change
Performance ⚠️ High memory usage ✅ Low overhead
Supported Icons Only monochrome masks Any PNG/SVG (multi-color, gradients)

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 with the IconLayer getColor implementation and iconMapping mask behavior described in the issue. Define how mask:false tint blending should preserve multicolor and gradient icon details, support dynamic updates, and avoid separate atlas generation; the payload does not name files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.