Skip to content

Let apps set the text, link, code and accent colors - #19

Merged
servercimen merged 1 commit into
feature/selection-changefrom
feature/style-colors
Nov 20, 2026
Merged

servercimen merged 1 commit into
feature/selection-changefrom
feature/style-colors

Conversation

@servercimen

@servercimen servercimen commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

The text was always UIColor.label, code blocks were always on secondarySystemFill, and links were a fixed blue that ignored dark mode.

  • TranscriptStyle.textColor, linkColor, codeBackgroundColor and accentColor (quote bars, rules, table lines). Each is a TranscriptColor with a light and a dark value. Nil keeps the system color that was used before.
  • Links now carry their color like a custom tag does (foregroundKey), so it is resolved for light or dark when the text is drawn. A tag's color still wins over it.
  • A style change also updates the tail's colors.

Closes #3.

Stack

This PR is part of a stack. It is based on #18 (feature/selection-change), so its diff shows only this change. Merge the stack in order, starting with #17.

Tests

  • Two new unit tests: a link takes the style's link color, and a tag's color wins over it. swift test: 124 tests pass.
  • Checked on an iPhone 12 mini, iOS 27.0: a snapshot of a text view with custom colors has pixels of each one. The red text has 264, the green link 113, the lilac code background 14,162, and the magenta quote bar 60.

🤖 Generated with Claude Code

The text was always UIColor.label, code blocks were always on
secondarySystemFill, and links were a fixed blue that ignored dark mode.

TranscriptStyle now has textColor, linkColor, codeBackgroundColor and
accentColor. Each is a TranscriptColor with light and dark values; nil
keeps the system color that was used before. Links now carry their color
like a custom tag does, so it is resolved for light or dark when the text
is drawn, and a tag's color still wins over it.

Closes #3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Let apps set the text, link and code colors

1 participant