Skip to content

VSCode: Need a light mode #68

Open

Description

@Artoria2e5

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.

Activity

  1. changed the title [-]Need a light mode[/-] [+]VSCode: Need a light mode[/+] on Sep 2, 2024
  2. ababaian commented on Sep 2, 2024

    @ababaian
    Member

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

  3. Artoria2e5 commented on Sep 2, 2024

    @Artoria2e5
    Author

    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

  4. ababaian commented on Sep 2, 2024

    @ababaian
    Member

    @liyao001 any ideas here?

  5. liyao001 commented on Sep 15, 2024

    @liyao001
    Contributor

    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.

  6. Artoria2e5 commented on Sep 17, 2024

    @Artoria2e5
    Author

    (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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions