From 2a899aa70219bcee2b0d3f02712f2f9f88a1daac Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Tue, 18 Apr 2023 15:17:10 -0400 Subject: [PATCH] Merge pull request #2384 from zed-industries/update-copilot-styles Update copilot styles --- styles/src/themes/common/syntax.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/styles/src/themes/common/syntax.ts b/styles/src/themes/common/syntax.ts index dcfd93628e764854482e85ba61df6714c91288f9..50c3e4e3b730de7e59ac22fd583f2620f8f82ef3 100644 --- a/styles/src/themes/common/syntax.ts +++ b/styles/src/themes/common/syntax.ts @@ -1,6 +1,7 @@ import deepmerge from "deepmerge" import { FontWeight, fontWeights } from "../../common" import { ColorScheme } from "./colorScheme" +import chroma from "chroma-js" export interface SyntaxHighlightStyle { color: string @@ -128,6 +129,8 @@ function buildDefaultSyntax(colorScheme: ColorScheme): Syntax { [key: string]: Omit } = {} + const light = colorScheme.isLight + // then spread the default to each style for (const key of Object.keys({} as Syntax)) { syntax[key as keyof Syntax] = { @@ -135,11 +138,20 @@ function buildDefaultSyntax(colorScheme: ColorScheme): Syntax { } } + // Mix the neutral and blue colors to get a + // predictive color distinct from any other color in the theme + const predictive = chroma.mix( + colorScheme.ramps.neutral(0.4).hex(), + colorScheme.ramps.blue(0.4).hex(), + 0.45, + "lch" + ).hex() + const color = { primary: colorScheme.ramps.neutral(1).hex(), comment: colorScheme.ramps.neutral(0.71).hex(), punctuation: colorScheme.ramps.neutral(0.86).hex(), - predictive: colorScheme.ramps.neutral(0.57).hex(), + predictive: predictive, emphasis: colorScheme.ramps.blue(0.5).hex(), string: colorScheme.ramps.orange(0.5).hex(), function: colorScheme.ramps.yellow(0.5).hex(),