monaco-vscode-textmate-theme-converter icon indicating copy to clipboard operation
monaco-vscode-textmate-theme-converter copied to clipboard

Handle non hex color value

Open dmnsgn opened this issue 5 years ago • 3 comments

Trying to convert https://github.com/akamud/vscode-theme-onedark for monaco-editor-textmate and getting Error: Illegal value for token color: because some color values can be:

  • css color: "white"
  • empty values: ""
  • keywords: "inherit", "transparent"

This is a limitation of monaco-editor unfortunately but maybe this package can parse and convert the values in order to provide compatible conversion? https://github.com/microsoft/monaco-editor/issues/1815

dmnsgn avatar Jul 29 '20 16:07 dmnsgn

Unfortunalely I wouldn't have time to update this, feel free to raise a PR if you wish to add this feature yourself @dmnsgn

Nishkalkashyap avatar Aug 14 '20 10:08 Nishkalkashyap

Best thing to do is to coerce those colors to #RRGGBB using chroma.js

ghost avatar Jul 18 '21 18:07 ghost

you can just generate the onedarkpro jsonc file in vscode rather than get it from the repo;

you can do this in vscode: cmd+shift+p and select generate color theme from current settings.

then use this tool transform it

yuzai avatar Apr 09 '22 03:04 yuzai