From 8bf0c436ecdbbbbf07a2221702d35b323cc27f9c Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 30 Nov 2018 14:20:37 -0800 Subject: 4805 More tweaking of colors, as far as possible in 256-color terminal mode that's almost entirely just for me, and beyond that in the generated html that more people may look at. In the former I have to work with a limited palette, while I'd like the latter to be more accessible for others. Evolution of colors: === 1 .subxH1Comment { color: #00ffff; } .subxH2Comment { color: #00afff; } .subxComment { color: #00afff; } .subxS1Comment { color: #0080ff; } .subxS2Comment { color: #0040ff; } === 2 sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00bbff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0098ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 3: http://www.perbang.dk/rgbgradient from start to end sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxH2Comment.*/.subxH2Comment { color:#00ddff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00bbff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#0099ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: drop down to 4 colors sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00d2ff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#00a4ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0078ff; }/' $1.html === 4: make final one just a little too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#00cfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#009fff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#0070ff; }/' $1.html # slightly too dark === 5: make darkest shade a little less blue, just at the edge of too dark sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16ccff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d99ff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark === 6: HSV gradient between the same endpoints sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html sed -i 's/^\.subxComment.*/.subxComment { color:#16bfff; }/' $1.html sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d8cff; }/' $1.html sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark --- subx/subx.vim | 7 ++++--- update_html | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/subx/subx.vim b/subx/subx.vim index 17286d01..e3c6a04f 100644 --- a/subx/subx.vim +++ b/subx/subx.vim @@ -19,9 +19,8 @@ setlocal iskeyword+=- "? syntax match subxComment /#.*$/ | highlight link subxComment Comment "? syntax match subxSalientComment /##.*$/ | highlight link subxSalientComment SalientComment -syntax match subxH1Comment /# =.*/ | highlight subxH1Comment ctermfg=14 -syntax match subxH2Comment /# -.*/ | highlight subxH2Comment ctermfg=39 -syntax match subxComment /#[^ ].*\|# [^.=-].*\|# \?$/ | highlight subxComment ctermfg=39 +syntax match subxH1Comment /# -.*/ | highlight subxH1Comment ctermfg=14 +syntax match subxComment /#[^ ].*\|# [^.-].*\|# \?$/ | highlight subxComment ctermfg=39 syntax match subxS1Comment /# \..*/ | highlight subxS1Comment ctermfg=27 syntax match subxS2Comment /# \. \..*/ | highlight subxS2Comment ctermfg=19 @@ -36,5 +35,7 @@ syntax match subxDelimiter / \. / | highlight link subxDelimiter CommentedCode syntax match subxString %"[^"]*"% | highlight link subxString Constant " match globals but not registers like 'EAX' syntax match subxGlobal %\<[A-Z][a-z0-9_-]*\>% | highlight link subxGlobal SpecialChar +" tweak the red color from the colorscheme just a tad to improve contrast +highlight SpecialChar ctermfg=196 let &cpo = s:save_cpo diff --git a/update_html b/update_html index 67ec92d8..62cece9c 100755 --- a/update_html +++ b/update_html @@ -22,20 +22,26 @@ convert_html() { sed -i 's/^body { \(.*\) }/body { font-size:12pt; \1 }/g' $1.html # turn most code grey sed -i 's/#eeeeee/#aaaaaa/g' $1.html - # ..so that we can use white for cross-links (underlining only on hover) - sed -i '/^body {/ a a:hover { text-decoration:underline; }' $1.html - sed -i '/^body {/ a a { color:#eeeeee; text-decoration:none; }' $1.html - # line numbers are darker still + # line numbers are darker than normal sed -i 's/^\.LineNr .*/.LineNr { color:#444444; }/' $1.html # line numbers # tweak contrast for remaining colors sed -i 's/^\.Constant .*/.Constant { color:#00a0a0; }/' $1.html sed -i 's/^\.muControl .*/.muControl { color:#c0a020; }/' $1.html - # real links in comments continue to be the usual blue - sed -i 's/^\.Comment .*/.Comment { color:#9090ff; }\n.Comment a { color:#0000ee; text-decoration:underline; }/' $1.html + # comment colors manually adjusted for better contrast; browser has >256 colors sed -i 's/^\.Delimiter .*/.Delimiter { color:#800080; }/' $1.html # not meant to be read; can be lower-contrast sed -i 's/^\.PreProc .*/.PreProc { color:#800080; }/' $1.html # not meant to be read; can be lower-contrast sed -i 's/^\.Identifier .*/.Identifier { color:#c0a020; }/' $1.html # same as muControl sed -i 's/^\.Special .*/.Special { color:#c00000; }/' $1.html # same as traceAbsent.. + sed -i 's/^\.subxH1Comment.*/.subxH1Comment { color:#00ffff; }/' $1.html + sed -i 's/^\.subxComment.*/.subxComment { color:#16bfff; }/' $1.html + sed -i 's/^\.subxS1Comment.*/.subxS1Comment { color:#2d8cff; }/' $1.html + sed -i 's/^\.subxS2Comment.*/.subxS2Comment { color:#4466ff; }/' $1.html # slightly too dark + # comment links in regular colors, just underlined + sed -i '/^body {/ a .subxH1Comment a { color:inherit; }' $1.html + sed -i '/^body {/ a .subxH2Comment a { color:inherit; }' $1.html + sed -i '/^body {/ a .subxComment a { color:inherit; }' $1.html + sed -i '/^body {/ a .subxS1Comment a { color:inherit; }' $1.html + sed -i '/^body {/ a .subxS2Comment a { color:inherit; }' $1.html # switch unicode characters around in the rendered html # the ones we have in the source files render double-wide in html -- cgit 1.4.1-2-gfad0