Skip to content

CellTextLayer ignores per-cell textColor from CellStyle #6

@witqq

Description

@witqq

Problem

CellTextLayer hardcodes theme.colors.cellText for ALL cells, ignoring cellData.style.textColor from CellStore/StylePool.

Current behavior (v0.1.0 and v0.2.1)

In dist/index.js, CellTextLayer sets:

ctx.fillStyle = rc.theme.colors.cellText; // ~line 1015 (v0.1.0)

This single color is used for every cell. After custom renderer.render(), the fillStyle is reset back to the theme color (~line 1074), overriding any per-cell color a custom renderer might have set.

Expected behavior

CellTextLayer should read cellData.style.textColor per-cell (when defined) and use it instead of the global theme color:

const textColor = cellData?.style?.textColor || rc.theme.colors.cellText;
ctx.fillStyle = textColor;

Impact

Without this, any application needing per-cell text colors (conditional formatting, user-defined styles) must implement a custom overlay layer that re-renders all styled cells on top of the engine's output, causing:

  • Double rendering overhead
  • Complex workarounds for semi-transparent backgrounds (engine's gray text bleeds through)
  • Maintenance burden

Versions affected

  • @witqq/spreadsheet 0.1.0
  • @witqq/spreadsheet 0.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions