[Feat] Improving the getColor method in IconLayer
Open
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:
- Only works with binary masks - completely replaces all non-transparent pixels with solid color
- Destroys image details - cannot preserve:
- Multi-tone icons (e.g. logos with shadows)
- Built-in color schemes
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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