diff options
| -rw-r--r-- | idatui/highlight.py | 31 |
1 files 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) |
