mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
Add DarkGray to the ColorTheme. (#12420)
This commit is contained in:
Generated
+1
@@ -17281,6 +17281,7 @@
|
|||||||
"strip-ansi": "^7.1.0",
|
"strip-ansi": "^7.1.0",
|
||||||
"strip-json-comments": "^3.1.1",
|
"strip-json-comments": "^3.1.1",
|
||||||
"tar": "^7.5.1",
|
"tar": "^7.5.1",
|
||||||
|
"tinygradient": "^1.1.5",
|
||||||
"undici": "^7.10.0",
|
"undici": "^7.10.0",
|
||||||
"wrap-ansi": "9.0.2",
|
"wrap-ansi": "9.0.2",
|
||||||
"yargs": "^17.7.2",
|
"yargs": "^17.7.2",
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
"strip-ansi": "^7.1.0",
|
"strip-ansi": "^7.1.0",
|
||||||
"strip-json-comments": "^3.1.1",
|
"strip-json-comments": "^3.1.1",
|
||||||
"tar": "^7.5.1",
|
"tar": "^7.5.1",
|
||||||
|
"tinygradient": "^1.1.5",
|
||||||
"undici": "^7.10.0",
|
"undici": "^7.10.0",
|
||||||
"wrap-ansi": "9.0.2",
|
"wrap-ansi": "9.0.2",
|
||||||
"yargs": "^17.7.2",
|
"yargs": "^17.7.2",
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ export const Colors: ColorsTheme = {
|
|||||||
get Gray() {
|
get Gray() {
|
||||||
return themeManager.getActiveTheme().colors.Gray;
|
return themeManager.getActiveTheme().colors.Gray;
|
||||||
},
|
},
|
||||||
|
get DarkGray() {
|
||||||
|
return themeManager.getActiveTheme().colors.DarkGray;
|
||||||
|
},
|
||||||
get GradientColors() {
|
get GradientColors() {
|
||||||
return themeManager.getActiveTheme().colors.GradientColors;
|
return themeManager.getActiveTheme().colors.GradientColors;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const ansiLightColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#FFE5E5',
|
DiffRemoved: '#FFE5E5',
|
||||||
Comment: 'gray',
|
Comment: 'gray',
|
||||||
Gray: 'gray',
|
Gray: 'gray',
|
||||||
|
DarkGray: 'gray',
|
||||||
GradientColors: ['blue', 'green'],
|
GradientColors: ['blue', 'green'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const ansiColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#4D0000',
|
DiffRemoved: '#4D0000',
|
||||||
Comment: 'gray',
|
Comment: 'gray',
|
||||||
Gray: 'gray',
|
Gray: 'gray',
|
||||||
|
DarkGray: 'gray',
|
||||||
GradientColors: ['cyan', 'green'],
|
GradientColors: ['cyan', 'green'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const atomOneDarkColors: ColorsTheme = {
|
const atomOneDarkColors: ColorsTheme = {
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
@@ -21,6 +22,7 @@ const atomOneDarkColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#562B2F',
|
DiffRemoved: '#562B2F',
|
||||||
Comment: '#5c6370',
|
Comment: '#5c6370',
|
||||||
Gray: '#5c6370',
|
Gray: '#5c6370',
|
||||||
|
DarkGray: interpolateColor('#5c6370', '#282c34', 0.5),
|
||||||
GradientColors: ['#61aeee', '#98c379'],
|
GradientColors: ['#61aeee', '#98c379'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const ayuLightColors: ColorsTheme = {
|
const ayuLightColors: ColorsTheme = {
|
||||||
type: 'light',
|
type: 'light',
|
||||||
@@ -21,6 +22,7 @@ const ayuLightColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#FFCCCC',
|
DiffRemoved: '#FFCCCC',
|
||||||
Comment: '#ABADB1',
|
Comment: '#ABADB1',
|
||||||
Gray: '#a6aaaf',
|
Gray: '#a6aaaf',
|
||||||
|
DarkGray: interpolateColor('#a6aaaf', '#f8f9fa', 0.5),
|
||||||
GradientColors: ['#399ee6', '#86b300'],
|
GradientColors: ['#399ee6', '#86b300'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const ayuDarkColors: ColorsTheme = {
|
const ayuDarkColors: ColorsTheme = {
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
@@ -21,6 +22,7 @@ const ayuDarkColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#3D1215',
|
DiffRemoved: '#3D1215',
|
||||||
Comment: '#646A71',
|
Comment: '#646A71',
|
||||||
Gray: '#3D4149',
|
Gray: '#3D4149',
|
||||||
|
DarkGray: interpolateColor('#3D4149', '#0b0e14', 0.5),
|
||||||
GradientColors: ['#FFB454', '#F26D78'],
|
GradientColors: ['#FFB454', '#F26D78'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { describe, it, expect } from 'vitest';
|
|||||||
import {
|
import {
|
||||||
isValidColor,
|
isValidColor,
|
||||||
resolveColor,
|
resolveColor,
|
||||||
|
interpolateColor,
|
||||||
CSS_NAME_TO_HEX_MAP,
|
CSS_NAME_TO_HEX_MAP,
|
||||||
INK_SUPPORTED_NAMES,
|
INK_SUPPORTED_NAMES,
|
||||||
} from './color-utils.js';
|
} from './color-utils.js';
|
||||||
@@ -218,4 +219,19 @@ describe('Color Utils', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('interpolateColor', () => {
|
||||||
|
it('should interpolate between two colors', () => {
|
||||||
|
// Midpoint between black (#000000) and white (#ffffff) should be gray
|
||||||
|
expect(interpolateColor('#000000', '#ffffff', 0.5)).toBe('#7f7f7f');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return start color when factor is 0', () => {
|
||||||
|
expect(interpolateColor('#ff0000', '#0000ff', 0)).toBe('#ff0000');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return end color when factor is 1', () => {
|
||||||
|
expect(interpolateColor('#ff0000', '#0000ff', 1)).toBe('#0000ff');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { debugLogger } from '@google/gemini-cli-core';
|
import { debugLogger } from '@google/gemini-cli-core';
|
||||||
|
import tinygradient from 'tinygradient';
|
||||||
|
|
||||||
// Mapping from common CSS color names (lowercase) to hex codes (lowercase)
|
// Mapping from common CSS color names (lowercase) to hex codes (lowercase)
|
||||||
// Excludes names directly supported by Ink
|
// Excludes names directly supported by Ink
|
||||||
@@ -231,3 +232,13 @@ export function resolveColor(colorValue: string): string | undefined {
|
|||||||
);
|
);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function interpolateColor(
|
||||||
|
color1: string,
|
||||||
|
color2: string,
|
||||||
|
factor: number,
|
||||||
|
) {
|
||||||
|
const gradient = tinygradient(color1, color2);
|
||||||
|
const color = gradient.rgbAt(factor);
|
||||||
|
return color.toHexString();
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const draculaColors: ColorsTheme = {
|
const draculaColors: ColorsTheme = {
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
@@ -21,6 +22,7 @@ const draculaColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#6e1818',
|
DiffRemoved: '#6e1818',
|
||||||
Comment: '#6272a4',
|
Comment: '#6272a4',
|
||||||
Gray: '#6272a4',
|
Gray: '#6272a4',
|
||||||
|
DarkGray: interpolateColor('#6272a4', '#282a36', 0.5),
|
||||||
GradientColors: ['#ff79c6', '#8be9fd'],
|
GradientColors: ['#ff79c6', '#8be9fd'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const githubDarkColors: ColorsTheme = {
|
const githubDarkColors: ColorsTheme = {
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
@@ -21,6 +22,7 @@ const githubDarkColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#502125',
|
DiffRemoved: '#502125',
|
||||||
Comment: '#6A737D',
|
Comment: '#6A737D',
|
||||||
Gray: '#6A737D',
|
Gray: '#6A737D',
|
||||||
|
DarkGray: interpolateColor('#6A737D', '#24292e', 0.5),
|
||||||
GradientColors: ['#79B8FF', '#85E89D'],
|
GradientColors: ['#79B8FF', '#85E89D'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const githubLightColors: ColorsTheme = {
|
const githubLightColors: ColorsTheme = {
|
||||||
type: 'light',
|
type: 'light',
|
||||||
@@ -21,6 +22,7 @@ const githubLightColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#FFCCCC',
|
DiffRemoved: '#FFCCCC',
|
||||||
Comment: '#998',
|
Comment: '#998',
|
||||||
Gray: '#999',
|
Gray: '#999',
|
||||||
|
DarkGray: interpolateColor('#999', '#f8f8f8', 0.5),
|
||||||
GradientColors: ['#458', '#008080'],
|
GradientColors: ['#458', '#008080'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme, lightTheme } from './theme.js';
|
import { type ColorsTheme, Theme, lightTheme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const googleCodeColors: ColorsTheme = {
|
const googleCodeColors: ColorsTheme = {
|
||||||
type: 'light',
|
type: 'light',
|
||||||
@@ -21,6 +22,7 @@ const googleCodeColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#FEDEDE',
|
DiffRemoved: '#FEDEDE',
|
||||||
Comment: '#5f6368',
|
Comment: '#5f6368',
|
||||||
Gray: lightTheme.Gray,
|
Gray: lightTheme.Gray,
|
||||||
|
DarkGray: interpolateColor(lightTheme.Gray, '#ffffff', 0.5),
|
||||||
GradientColors: ['#066', '#606'],
|
GradientColors: ['#066', '#606'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const noColorColorsTheme: ColorsTheme = {
|
|||||||
DiffRemoved: '',
|
DiffRemoved: '',
|
||||||
Comment: '',
|
Comment: '',
|
||||||
Gray: '',
|
Gray: '',
|
||||||
|
DarkGray: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
const noColorSemanticColors: SemanticColors = {
|
const noColorSemanticColors: SemanticColors = {
|
||||||
@@ -46,6 +47,7 @@ const noColorSemanticColors: SemanticColors = {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: '',
|
comment: '',
|
||||||
symbol: '',
|
symbol: '',
|
||||||
|
dark: '',
|
||||||
gradient: [],
|
gradient: [],
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export interface SemanticColors {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: string;
|
comment: string;
|
||||||
symbol: string;
|
symbol: string;
|
||||||
|
dark: string;
|
||||||
gradient: string[] | undefined;
|
gradient: string[] | undefined;
|
||||||
};
|
};
|
||||||
status: {
|
status: {
|
||||||
@@ -57,6 +58,7 @@ export const lightSemanticColors: SemanticColors = {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: lightTheme.Comment,
|
comment: lightTheme.Comment,
|
||||||
symbol: lightTheme.Gray,
|
symbol: lightTheme.Gray,
|
||||||
|
dark: lightTheme.DarkGray,
|
||||||
gradient: lightTheme.GradientColors,
|
gradient: lightTheme.GradientColors,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
@@ -87,6 +89,7 @@ export const darkSemanticColors: SemanticColors = {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: darkTheme.Comment,
|
comment: darkTheme.Comment,
|
||||||
symbol: darkTheme.Gray,
|
symbol: darkTheme.Gray,
|
||||||
|
dark: darkTheme.DarkGray,
|
||||||
gradient: darkTheme.GradientColors,
|
gradient: darkTheme.GradientColors,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
@@ -117,6 +120,7 @@ export const ansiSemanticColors: SemanticColors = {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: ansiTheme.Comment,
|
comment: ansiTheme.Comment,
|
||||||
symbol: ansiTheme.Gray,
|
symbol: ansiTheme.Gray,
|
||||||
|
dark: ansiTheme.DarkGray,
|
||||||
gradient: ansiTheme.GradientColors,
|
gradient: ansiTheme.GradientColors,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
* @author Ahmad Awais <https://twitter.com/mrahmadawais/>
|
* @author Ahmad Awais <https://twitter.com/mrahmadawais/>
|
||||||
*/
|
*/
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const shadesOfPurpleColors: ColorsTheme = {
|
const shadesOfPurpleColors: ColorsTheme = {
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
@@ -26,6 +27,7 @@ const shadesOfPurpleColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#572244',
|
DiffRemoved: '#572244',
|
||||||
Comment: '#B362FF', // Comment color (same as AccentPurple)
|
Comment: '#B362FF', // Comment color (same as AccentPurple)
|
||||||
Gray: '#726c86', // Gray color
|
Gray: '#726c86', // Gray color
|
||||||
|
DarkGray: interpolateColor('#726c86', '#2d2b57', 0.5),
|
||||||
GradientColors: ['#4d21fc', '#847ace', '#ff628c'],
|
GradientColors: ['#4d21fc', '#847ace', '#ff628c'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,80 @@ import { describe, it, expect } from 'vitest';
|
|||||||
import * as themeModule from './theme.js';
|
import * as themeModule from './theme.js';
|
||||||
import { themeManager } from './theme-manager.js';
|
import { themeManager } from './theme-manager.js';
|
||||||
|
|
||||||
const { validateCustomTheme } = themeModule;
|
const { validateCustomTheme, createCustomTheme } = themeModule;
|
||||||
type CustomTheme = themeModule.CustomTheme;
|
type CustomTheme = themeModule.CustomTheme;
|
||||||
|
|
||||||
|
describe('createCustomTheme', () => {
|
||||||
|
const baseTheme: CustomTheme = {
|
||||||
|
type: 'custom',
|
||||||
|
name: 'Test Theme',
|
||||||
|
Background: '#000000',
|
||||||
|
Foreground: '#ffffff',
|
||||||
|
LightBlue: '#ADD8E6',
|
||||||
|
AccentBlue: '#0000FF',
|
||||||
|
AccentPurple: '#800080',
|
||||||
|
AccentCyan: '#00FFFF',
|
||||||
|
AccentGreen: '#008000',
|
||||||
|
AccentYellow: '#FFFF00',
|
||||||
|
AccentRed: '#FF0000',
|
||||||
|
DiffAdded: '#00FF00',
|
||||||
|
DiffRemoved: '#FF0000',
|
||||||
|
Comment: '#808080',
|
||||||
|
Gray: '#cccccc',
|
||||||
|
// DarkGray intentionally omitted to test fallback
|
||||||
|
};
|
||||||
|
|
||||||
|
it('should interpolate DarkGray when not provided', () => {
|
||||||
|
const theme = createCustomTheme(baseTheme);
|
||||||
|
// Interpolate between Gray (#cccccc) and Background (#000000) at 0.5
|
||||||
|
// #cccccc is RGB(204, 204, 204)
|
||||||
|
// #000000 is RGB(0, 0, 0)
|
||||||
|
// Midpoint is RGB(102, 102, 102) which is #666666
|
||||||
|
expect(theme.colors.DarkGray).toBe('#666666');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should use provided DarkGray', () => {
|
||||||
|
const theme = createCustomTheme({
|
||||||
|
...baseTheme,
|
||||||
|
DarkGray: '#123456',
|
||||||
|
});
|
||||||
|
expect(theme.colors.DarkGray).toBe('#123456');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should interpolate DarkGray when text.secondary is provided but DarkGray is not', () => {
|
||||||
|
const customTheme: CustomTheme = {
|
||||||
|
type: 'custom',
|
||||||
|
name: 'Test',
|
||||||
|
text: {
|
||||||
|
secondary: '#cccccc', // Gray source
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
primary: '#000000', // Background source
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const theme = createCustomTheme(customTheme);
|
||||||
|
// Should be interpolated between #cccccc and #000000 at 0.5 -> #666666
|
||||||
|
expect(theme.colors.DarkGray).toBe('#666666');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should prefer text.secondary over Gray for interpolation', () => {
|
||||||
|
const customTheme: CustomTheme = {
|
||||||
|
type: 'custom',
|
||||||
|
name: 'Test',
|
||||||
|
text: {
|
||||||
|
secondary: '#cccccc', // Should be used
|
||||||
|
},
|
||||||
|
Gray: '#aaaaaa', // Should be ignored
|
||||||
|
background: {
|
||||||
|
primary: '#000000',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const theme = createCustomTheme(customTheme);
|
||||||
|
// Interpolate between #cccccc and #000000 -> #666666
|
||||||
|
expect(theme.colors.DarkGray).toBe('#666666');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('validateCustomTheme', () => {
|
describe('validateCustomTheme', () => {
|
||||||
const validTheme: CustomTheme = {
|
const validTheme: CustomTheme = {
|
||||||
type: 'custom',
|
type: 'custom',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import type { CSSProperties } from 'react';
|
import type { CSSProperties } from 'react';
|
||||||
import type { SemanticColors } from './semantic-tokens.js';
|
import type { SemanticColors } from './semantic-tokens.js';
|
||||||
import { resolveColor } from './color-utils.js';
|
import { resolveColor, interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
export type ThemeType = 'light' | 'dark' | 'ansi' | 'custom';
|
export type ThemeType = 'light' | 'dark' | 'ansi' | 'custom';
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@ export interface ColorsTheme {
|
|||||||
DiffRemoved: string;
|
DiffRemoved: string;
|
||||||
Comment: string;
|
Comment: string;
|
||||||
Gray: string;
|
Gray: string;
|
||||||
|
DarkGray: string;
|
||||||
GradientColors?: string[];
|
GradientColors?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,13 +75,14 @@ export interface CustomTheme {
|
|||||||
DiffRemoved?: string;
|
DiffRemoved?: string;
|
||||||
Comment?: string;
|
Comment?: string;
|
||||||
Gray?: string;
|
Gray?: string;
|
||||||
|
DarkGray?: string;
|
||||||
GradientColors?: string[];
|
GradientColors?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const lightTheme: ColorsTheme = {
|
export const lightTheme: ColorsTheme = {
|
||||||
type: 'light',
|
type: 'light',
|
||||||
Background: '#FAFAFA',
|
Background: '#FAFAFA',
|
||||||
Foreground: '',
|
Foreground: '#383A42',
|
||||||
LightBlue: '#89BDCD',
|
LightBlue: '#89BDCD',
|
||||||
AccentBlue: '#3B82F6',
|
AccentBlue: '#3B82F6',
|
||||||
AccentPurple: '#8B5CF6',
|
AccentPurple: '#8B5CF6',
|
||||||
@@ -92,13 +94,14 @@ export const lightTheme: ColorsTheme = {
|
|||||||
DiffRemoved: '#FFCCCC',
|
DiffRemoved: '#FFCCCC',
|
||||||
Comment: '#008000',
|
Comment: '#008000',
|
||||||
Gray: '#97a0b0',
|
Gray: '#97a0b0',
|
||||||
|
DarkGray: interpolateColor('#97a0b0', '#FAFAFA', 0.5),
|
||||||
GradientColors: ['#4796E4', '#847ACE', '#C3677F'],
|
GradientColors: ['#4796E4', '#847ACE', '#C3677F'],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const darkTheme: ColorsTheme = {
|
export const darkTheme: ColorsTheme = {
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
Background: '#1E1E2E',
|
Background: '#1E1E2E',
|
||||||
Foreground: '',
|
Foreground: '#CDD6F4',
|
||||||
LightBlue: '#ADD8E6',
|
LightBlue: '#ADD8E6',
|
||||||
AccentBlue: '#89B4FA',
|
AccentBlue: '#89B4FA',
|
||||||
AccentPurple: '#CBA6F7',
|
AccentPurple: '#CBA6F7',
|
||||||
@@ -110,6 +113,7 @@ export const darkTheme: ColorsTheme = {
|
|||||||
DiffRemoved: '#430000',
|
DiffRemoved: '#430000',
|
||||||
Comment: '#6C7086',
|
Comment: '#6C7086',
|
||||||
Gray: '#6C7086',
|
Gray: '#6C7086',
|
||||||
|
DarkGray: interpolateColor('#6C7086', '#1E1E2E', 0.5),
|
||||||
GradientColors: ['#4796E4', '#847ACE', '#C3677F'],
|
GradientColors: ['#4796E4', '#847ACE', '#C3677F'],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,6 +132,7 @@ export const ansiTheme: ColorsTheme = {
|
|||||||
DiffRemoved: 'red',
|
DiffRemoved: 'red',
|
||||||
Comment: 'gray',
|
Comment: 'gray',
|
||||||
Gray: 'gray',
|
Gray: 'gray',
|
||||||
|
DarkGray: 'gray',
|
||||||
};
|
};
|
||||||
|
|
||||||
export class Theme {
|
export class Theme {
|
||||||
@@ -176,6 +181,7 @@ export class Theme {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: this.colors.Gray,
|
comment: this.colors.Gray,
|
||||||
symbol: this.colors.AccentCyan,
|
symbol: this.colors.AccentCyan,
|
||||||
|
dark: this.colors.DarkGray,
|
||||||
gradient: this.colors.GradientColors,
|
gradient: this.colors.GradientColors,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
@@ -267,6 +273,13 @@ export function createCustomTheme(customTheme: CustomTheme): Theme {
|
|||||||
customTheme.background?.diff?.removed ?? customTheme.DiffRemoved ?? '',
|
customTheme.background?.diff?.removed ?? customTheme.DiffRemoved ?? '',
|
||||||
Comment: customTheme.ui?.comment ?? customTheme.Comment ?? '',
|
Comment: customTheme.ui?.comment ?? customTheme.Comment ?? '',
|
||||||
Gray: customTheme.text?.secondary ?? customTheme.Gray ?? '',
|
Gray: customTheme.text?.secondary ?? customTheme.Gray ?? '',
|
||||||
|
DarkGray:
|
||||||
|
customTheme.DarkGray ??
|
||||||
|
interpolateColor(
|
||||||
|
customTheme.text?.secondary ?? customTheme.Gray ?? '',
|
||||||
|
customTheme.background?.primary ?? customTheme.Background ?? '',
|
||||||
|
0.5,
|
||||||
|
),
|
||||||
GradientColors: customTheme.ui?.gradient ?? customTheme.GradientColors,
|
GradientColors: customTheme.ui?.gradient ?? customTheme.GradientColors,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -429,6 +442,7 @@ export function createCustomTheme(customTheme: CustomTheme): Theme {
|
|||||||
ui: {
|
ui: {
|
||||||
comment: customTheme.ui?.comment ?? colors.Comment,
|
comment: customTheme.ui?.comment ?? colors.Comment,
|
||||||
symbol: customTheme.ui?.symbol ?? colors.Gray,
|
symbol: customTheme.ui?.symbol ?? colors.Gray,
|
||||||
|
dark: colors.DarkGray,
|
||||||
gradient: customTheme.ui?.gradient ?? colors.GradientColors,
|
gradient: customTheme.ui?.gradient ?? colors.GradientColors,
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type ColorsTheme, Theme } from './theme.js';
|
import { type ColorsTheme, Theme } from './theme.js';
|
||||||
|
import { interpolateColor } from './color-utils.js';
|
||||||
|
|
||||||
const xcodeColors: ColorsTheme = {
|
const xcodeColors: ColorsTheme = {
|
||||||
type: 'light',
|
type: 'light',
|
||||||
@@ -21,6 +22,7 @@ const xcodeColors: ColorsTheme = {
|
|||||||
DiffRemoved: '#FEDEDE',
|
DiffRemoved: '#FEDEDE',
|
||||||
Comment: '#007400',
|
Comment: '#007400',
|
||||||
Gray: '#c0c0c0',
|
Gray: '#c0c0c0',
|
||||||
|
DarkGray: interpolateColor('#c0c0c0', '#fff', 0.5),
|
||||||
GradientColors: ['#1c00cf', '#007400'],
|
GradientColors: ['#1c00cf', '#007400'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user