From 3aecc7bcde7251a9d0821aee4741ed7fc10d6c58 Mon Sep 17 00:00:00 2001 From: blasty Date: Sat, 25 Jul 2026 21:05:52 +0200 Subject: highlight: bring pseudocode onto the measured palette MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit highlight.py was still carrying VS Code Dark+ (#c586c0 keywords, #4ec9b0 types, #dcdcaa identifiers) — an entirely different colour system from the listing, which moved to a measured palette in d1cfab2. Reading a function in split view meant reading two unrelated themes side by side, with the same thing coloured differently in each pane. Same palette in both panes now, so one hue means one thing everywhere: a string is #9ece6a and a symbol #7aa2f7 whether you're in disassembly or pseudocode. Contrast against the app background #12161c, signal 7:1+ and structure 3-4:1: keyword (control) #e8ecf2 15.3 operator/body #c3cad3 11.0 string #9ece6a 9.9 number #d8a657 8.2 type/builtin #93aee0 8.1 name #7aa2f7 7.2 comment #7c8b9e 5.2 punctuation #626c7a 3.4 Control keywords take the brightest NEUTRAL rather than a hue, mirroring the mnemonic column: they're the skeleton you scan for, and a hue there would claim a meaning the rest of the palette already assigns. Punctuation drops from grey70 to 3.4:1 — it was competing with the code it delimits. Suite 192/0. --- idatui/highlight.py | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/idatui/highlight.py b/idatui/highlight.py index 9fc692f..5f504bf 100644 --- a/idatui/highlight.py +++ b/idatui/highlight.py @@ -15,19 +15,28 @@ from pygments.lexers import CLexer from pygments.token import Token # Token -> style, checked in priority order (first hierarchical match wins). -# Palette roughly follows a dark IDE theme. +# +# Same measured palette as the listing (see the theme notes): one hue = one +# meaning across BOTH panes, so a string is the same green and a symbol the same +# blue whether you're reading disassembly or pseudocode. Contrast ratios are +# against the app background #12161c; signal sits at 7:1+ and structure recedes +# to 3-4:1 so punctuation stops competing with the code. +# +# Control keywords take the brightest NEUTRAL rather than a hue, mirroring the +# mnemonic column: they're the skeleton you scan for, and a hue there would +# claim a meaning the rest of the palette already assigns. _STYLES: list[tuple[object, Style]] = [ - (Token.Comment, Style(color="grey54", italic=True)), - (Token.Keyword.Type, Style(color="#4ec9b0")), # __int64, char, ... - (Token.Keyword, Style(color="#c586c0", bold=True)), # if/else/return/goto - (Token.Name.Builtin, Style(color="#4ec9b0")), - (Token.Literal.String, Style(color="#ce9178")), # "..." - (Token.Literal.Number, Style(color="#b5cea8")), # 0x10, 42 - (Token.Operator, Style(color="#d4d4d4")), - (Token.Punctuation, Style(color="grey70")), - (Token.Name, Style(color="#dcdcaa")), # identifiers / calls + (Token.Comment, Style(color="#7c8b9e", italic=True)), # 5.2:1 commentary + (Token.Keyword.Type, Style(color="#93aee0")), # 8.1:1 type info + (Token.Keyword, Style(color="#e8ecf2", bold=True)), # 15.3:1 control flow + (Token.Name.Builtin, Style(color="#93aee0")), # 8.1:1 type info + (Token.Literal.String, Style(color="#9ece6a")), # 9.9:1 strings + (Token.Literal.Number, Style(color="#d8a657")), # 8.2:1 data/number + (Token.Operator, Style(color="#c3cad3")), # 11.0:1 body + (Token.Punctuation, Style(color="#626c7a")), # 3.4:1 structure + (Token.Name, Style(color="#7aa2f7")), # 7.2:1 symbol names ] -_DEFAULT = Style(color="#d4d4d4") +_DEFAULT = Style(color="#c3cad3") # 11.0:1 body _lexer = CLexer(stripnl=False, ensurenl=False) -- cgit v1.3.1-sl0p