Skip to content

kas::text::format::Color: use internal 32-bit RGBA value#670

Merged
dhardy merged 1 commit intomasterfrom
push-ytrwtspqsplv
Mar 2, 2026
Merged

kas::text::format::Color: use internal 32-bit RGBA value#670
dhardy merged 1 commit intomasterfrom
push-ytrwtspqsplv

Conversation

@dhardy
Copy link
Collaborator

@dhardy dhardy commented Feb 20, 2026

Previously, a palette index was used for text colours. This stores the colour in effect tokens instead.

Advantages:

  • Easier to map to from other APIs, e.g. highlighters which don't present colours via a palette
  • Saves passing palette: &[Rgba] into text drawing functions

Disadvantages:

  • Limited to 32-bit (sRGB) colours
  • Larger effect tokens (8 bytes instead of 4)

As a space optimisation, completely transparent text will resolve to the theme's text colour instead.

@dhardy dhardy merged commit a9e10c0 into master Mar 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant