bioSyntax icon indicating copy to clipboard operation
bioSyntax copied to clipboard

VSCode: Need a light mode

Open Artoria2e5 opened this issue 1 year ago • 5 comments

Some of us are used to using VSCode in a light mode. Perhaps a light-based bioSyntax theme can be made too?

Since we are going to be using JS, we can probably invert the lightness (but not the hue and chroma) dynamically to make a color suitable for light mode:

import {
  useMode,
  modeOklab,
  formatHex,
  toGamut,
  parseHex
} from 'culori';

const oklab = useMode(modeOklab);
const rgb = toGamut('rgb');

function hexify(x) {
  return formatHex(rgb(x))
}

function invL(x) {
  const okx = oklab(x)
  okx.l = 1 - okx.l
  return okx
}

console.log(hexify(invL(parseHex("#663399"))))

This way no additional columns need to be added to the xls.

Artoria2e5 avatar Sep 02 '24 05:09 Artoria2e5

I like the idea of a light-mode for VSCode (and perhaps Sublime too). Great feature suggestion!

ababaian avatar Sep 02 '24 15:09 ababaian

Hmm. How is theme/bioSyntax.json getting generated? There doesn't seem to be an analogue of makeThemeXML.sh for it...


The most similar file in the vscode codebase is https://github.com/microsoft/vscode/blob/main/extensions/theme-defaults/themes/dark_vs.json. I'd think a version from ~6 years ago, maybe https://github.com/microsoft/vscode/blob/4719230bf56f7ae14215a2bc661fb1ee45f7c168/extensions/theme-defaults/themes/dark_vs.json, is the ancestor here.

I'm thinking that we write a bit of JS to do the color thing and generate it... Probably from a "base" theme like the above and a tsv

Artoria2e5 avatar Sep 02 '24 17:09 Artoria2e5

@liyao001 any ideas here?

ababaian avatar Sep 02 '24 17:09 ababaian

Writing some JS for a dark/light switch is a great idea.

If I remember correctly, the theme file was derived by combining files for the default Dark theme (extensions/theme-defaults/themes/dark_vs.json) (the first 560 lines?) and bioSyntax-sublime. We may be able to introduce a light theme by replacing the first part with configurations from the default light theme, but we have to test whether the strategy still works after so many iterations from the VSCode side.

liyao001 avatar Sep 15 '24 19:09 liyao001

(Some of the) colors still need adapting because dark and white backgrounds need different colors for visibility and overall color match. I'm starting to think more and more of this should indeed go into the xls... Maybe even the colorspace stuff...

Artoria2e5 avatar Sep 17 '24 14:09 Artoria2e5