From 9ade271a67a9fae0d89f8138970679c9730e9fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 21 May 2019 14:04:54 +0300 Subject: Use ThemeColor and add support for light themes --- editors/code/src/highlighting.ts | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'editors/code/src/highlighting.ts') diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 2521dff62..432f40ff4 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts @@ -13,23 +13,32 @@ export class Highlighter { string, vscode.TextEditorDecorationType > { - const decor = (color: string) => - vscode.window.createTextEditorDecorationType({ color }); + const colorContrib = ( + tag: string + ): [string, vscode.TextEditorDecorationType] => { + const color = new vscode.ThemeColor('ralsp.' + tag); + const decor = vscode.window.createTextEditorDecorationType({ + color + }); + return [tag, decor]; + }; const decorations: Iterable< [string, vscode.TextEditorDecorationType] > = [ - ['background', decor('#3F3F3F')], - ['comment', decor('#7F9F7F')], - ['string', decor('#CC9393')], - ['keyword', decor('#F0DFAF')], - ['function', decor('#93E0E3')], - ['parameter', decor('#94BFF3')], - ['builtin', decor('#DD6718')], - ['text', decor('#DCDCCC')], - ['attribute', decor('#BFEBBF')], - ['literal', decor('#DFAF8F')], - ['macro', decor('#DFAF8F')] + colorContrib('background'), + colorContrib('comment'), + colorContrib('string'), + colorContrib('unsafe'), + colorContrib('keyword'), + colorContrib('control'), + colorContrib('function'), + colorContrib('parameter'), + colorContrib('builtin'), + colorContrib('text'), + colorContrib('attribute'), + colorContrib('literal'), + colorContrib('macro') ]; return new Map(decorations); -- cgit v1.2.3