feat: add true color (24-bit RGB) support to MicronColor via FT/BT commands#673
feat: add true color (24-bit RGB) support to MicronColor via FT/BT commands#673torlando-tech wants to merge 2 commits into
Conversation
…mmands Extend Micron markup to support full 24-bit true color alongside the existing 3-char (12-bit) hex and grayscale formats. The new syntax uses `FTrrggbb` for foreground and `BTrrggbb` for background, keeping full backward compatibility with existing `Fxxx`/`Bxxx` shorthand. https://claude.ai/code/session_015rjJisX2XNt331xgXdFbB9
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis PR extends Micron inline markup with 24-bit true color via
Confidence Score: 5/5Safe to merge — the change is additive, backward-compatible, and the previously identified T-leak and constant-duplication concerns are both resolved. The true-color dispatch is correct, the malformed-command fallback returns null cleanly instead of leaking No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["backtick command: F or B"] --> B["parseForegroundOrBackground()"]
B --> C{next char == 'T'?}
C -- yes --> D{colorStart + 6 <= line.length?}
D -- yes --> E["extract 6 chars\nMicronColor.parseTrueColor()"]
E --> F{color != null?}
F -- yes --> G["FormatResult with\ntrue-color Hex(r,g,b)"]
F -- no --> H["return null\n(malformed FTxxxxxx)"]
D -- no --> H
C -- no --> I{afterCmd + 3 <= line.length?}
I -- yes --> J["extract 3 chars\nMicronColor.parse()"]
J --> K{color != null?}
K -- yes --> L["FormatResult with\n3-char Hex or Grayscale"]
K -- no --> M["return null"]
I -- no --> M
Reviews (2): Last reviewed commit: "chore(greptile): iteration 1 — applied 2..." | Re-trigger Greptile |
- MicronParser.parseForegroundOrBackground: when 'T' is committed as a true-color marker but the 6-char hex parse fails (length too short or bad digit), return null directly instead of falling through to the 3-char branch with a substring starting at 'T'. T is never a valid hex digit, so the fallback always failed; the early return makes the intent explicit and avoids a pointless second parse attempt. - Deduplicate TRUE_COLOR_LEN: it was defined as a private const in both MicronColor.companion (line 44) and MicronParser (line 373). Promote MicronColor's to internal and drop MicronParser's copy so there is a single source of truth for the true-color hex length. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extend Micron markup to support full 24-bit true color alongside the
existing 3-char (12-bit) hex and grayscale formats. The new syntax uses
FTrrggbbfor foreground andBTrrggbbfor background, keeping fullbackward compatibility with existing
Fxxx/Bxxxshorthand.https://claude.ai/code/session_015rjJisX2XNt331xgXdFbB9