STEPS TO REPRODUCE 1. Use GitHub Dark theme in Kate 2. Open csv file with 10+ columns OBSERVED RESULT CSV files have the following syntax highlighting: white #e1e4e8 columns 0, 8 orange #ffab70 column 1 light blue #9ecbff columns 2, 5 red #f97583 columns 3, 4, 9 purple #b392f0 column 6 medium blue #79b8ff column 7 This means three colours are repeated, two of the red columns are next to each other, and the white columns are only separated by one other column. The two blues are also extremely similar, so in practice there are three barely distinguishable blue columns. And the pattern repeats every 10 columns, so in a 20-column csv, six are blue and look essentially the same, and another six are all the same red! Legibility of csv files with GitHub Dark is thus much worse in comparison to e.g. Breeze. The palette of GH Dark is very restricted in comparison to Breeze, so it will never be ideal for distinguishing colours, but a more sensible implementation is surely possible. EXPECTED RESULT I'm not sure to what extent the set of colours and method of syntax highlighting of the GitHub themes are determined by how GitHub does it, but there must be a better way of doing specifically CSV syntax. I would suggest either settling on five colours and repeating them every 5 columns rather than 10, but spaced evenly: PROPOSAL 1 white #e1e4e8 columns 0, 5 orange #ffab70 column 1, 6 light blue #9ecbff columns 2, 7 red #f97583 columns 3, 8 purple #b392f0 column 4, 9 In this version, there are twice as many columns of each colour vs Breeze, but at least every column has high contrast with its neighbours and all colours are distinguishable. My second suggestion would be to add in the dark blue, grey, and dark red from the Python syntax highlighting, for a total of 9 colours, then simply adding a tenth colour that fits nicely with the palette. To keep it in-keeping with the GH palette, which really doesn't have any other colours, how about a grey halfway between the grey and white? Then space the reds, blues and greys out to get: PROPOSAL 2 white #e1e4e8 column 0 orange #ffab70 column 1 light blue #9ecbff column 2 red #f97583 column 3 light grey #a6acb3 column 4 medium blue #79b8ff column 5 purple #b392f0 column 6 grey #6a737d column 7 dark blue #41a0ff column 8 dark red #ff5555 column 9 This way no colour is next to another of the same, there are no clusters, and each greyscale/red/blue is flanked by different pairs of colours to the others, helping legibility. SOFTWARE/OS VERSIONS Linux/KDE Plasma: OpenSUSE Tumbleweed 20231108 KDE Plasma Version: 5.27.9 KDE Frameworks Version: 5.111.0 Qt Version: 5.15.11
Git commit 11980feb06c982760b34d9fa7a8402efd506276d by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 14/08/2025 at 17:24. Pushed by cullmann into branch 'master'. fix themes with two adjacent color in CSV syntaxes All themes are modified to use 5 distinct colors, with the exception of Vim Dark, which uses 10 colors. The following program allows you to select a color (`names` variable) and generate the JSON of the 'custom-styles' theme: ```js const {openSync, readSync} = require('fs'); const fd = openSync('/dev/stdin'); const buf = Buffer.alloc(1024 * 1024); const len = readSync(fd, buf); if (len === 0) { exit(1) } o = JSON.parse(buf.subarray(0, len).toString())['text-styles'] // 0 1 2 3 4 5 6 7 8 9 names = ['Normal', 'Variable', 'String', 'BuiltIn', 'Preprocessor', 'Char', 'Function', 'BaseN', 'Operator', 'DataType'] names = ['Normal', 'Variable', 'String', 'BuiltIn', 'Preprocessor'] f = (i) => { const name = names[i] || names[i % 5]; return ` "Column ${i}": { "selected-text-color": "${o[name]['selected-text-color']}", "text-color": "${o[name]['text-color']}" },` } r1 = `${f(0)}${f(1)}${f(2)}${f(3)}${f(4)}`; r2 = `${f(5)}${f(6)}${f(7)}${f(8)}${f(9)}`; r3 = r1.replaceAll('": {', ' Separator": {').replaceAll('"\n"', '",\n "bold": true"') r4 = r2.replaceAll('": {', ' Separator": {').replaceAll('"\n"', '",\n "bold": true"') r = `${r1}${r2}${r3}${r4.substr(0,r4.length-1)}` console.log(` "CSV": {${r} }, "TSV": {${r} }, "CSV (semicolon)": {${r} }, "CSV (whitespace)": {${r} }, "CSV (pipe)": {${r} }`) ``` ```sh node prog.js <file.theme | xclip -selection clipboard ``` The following removes unnecessary column redefinitions from a theme: (If column 9 is deleted, the end comma must manually delete.) ```sh sed -E '/"Column [049]/,/}/d' -i data/themes/tokyo-night-light.theme ``` The following program allows a visualization of a theme (deal with `XDG_DATA_DIRS` and symbolic links to use the themes of the repository): ```sh theme='Vim Dark' r=$(ksyntaxhighlighter6 -fansi -s csv -t "$theme" <<<"aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,xx,$theme" \ | sed -E 's/\x1b\[38;2;([^m]+)m([a-z]{2})/\x1b[38;2;\1m[\1]\2/g') echo -n "$r" r=${r/xx*/} s=' ' s="${s:1:$((${#r}/43))}" echo " 0${s}1${s}2${s}3${s}4${s}5${s}6${s}7${s}8${s}9 " ``` themes M +3 -3 autotests/html/highlight.csv-pipe.dark.html M +3 -3 autotests/html/highlight.csv-pipe.html M +4 -4 autotests/html/highlight.csv-semicolon.dark.html M +4 -4 autotests/html/highlight.csv-semicolon.html M +2 -2 autotests/html/highlight.csv-whitespace.dark.html M +2 -2 autotests/html/highlight.csv-whitespace.html M +4 -4 autotests/html/highlight.csv.dark.html M +4 -4 autotests/html/highlight.csv.html M +2 -2 autotests/html/highlight.tsv.dark.html M +2 -2 autotests/html/highlight.tsv.html M +11 -11 data/syntax/csv-whitespace.xml M +11 -11 data/syntax/tsv.xml M +211 -1 data/themes/atom-one-dark.theme M +211 -1 data/themes/atom-one-light.theme M +291 -1 data/themes/ayu-dark.theme M +293 -1 data/themes/ayu-light.theme M +251 -1 data/themes/ayu-mirage.theme M +294 -2 data/themes/breeze-dark.theme M +299 -2 data/themes/breeze-light.theme M +331 -1 data/themes/catppuccin-frappe.theme M +331 -1 data/themes/catppuccin-latte.theme M +331 -1 data/themes/catppuccin-macchiato.theme M +331 -1 data/themes/catppuccin-mocha.theme M +381 -1 data/themes/dracula.theme M +311 -1 data/themes/falcon.theme M +251 -1 data/themes/github-dark.theme M +251 -1 data/themes/github-light.theme M +294 -2 data/themes/gruvbox-dark.theme M +294 -2 data/themes/gruvbox-light.theme M +331 -1 data/themes/homunculus.theme M +341 -1 data/themes/monokai.theme M +344 -1 data/themes/nord.theme M +298 -1 data/themes/oblivion.theme M +214 -2 data/themes/printing.theme M +253 -1 data/themes/radical.theme M +371 -1 data/themes/solarized-dark.theme M +376 -1 data/themes/solarized-light.theme M +371 -1 data/themes/tokyo-night-light.theme M +371 -1 data/themes/tokyo-night-storm.theme M +371 -1 data/themes/tokyo-night.theme M +379 -2 data/themes/vim-dark.theme M +251 -1 data/themes/vscodium-dark.theme https://invent.kde.org/frameworks/syntax-highlighting/-/commit/11980feb06c982760b34d9fa7a8402efd506276d