diff --git a/nix/yarn-project.nix b/nix/yarn-project.nix index 9f1b437c..3a87a2b6 100644 --- a/nix/yarn-project.nix +++ b/nix/yarn-project.nix @@ -55,7 +55,7 @@ let rm $out/.gitignore ''; outputHashMode = "recursive"; - outputHash = "sha512-hoLzOaE5fvtkoVutJNQ6o/3sQB2sBuPU3H1knHiLHh6qJniJK1r0nf7qOhePsuqzZgSbAdguot2N8VD+2oRB9A=="; + outputHash = "sha512-ciFAqqoMV8Eb7PH6gZWTMBDHnWgBTYCqhgSsk6i7AmP0923iIOyXqGjU6yve7hdhQWOisMYYO47EoJePxpXHRw=="; }; # Main project derivation. diff --git a/packages/catppuccin-vsc-storybook/package.json b/packages/catppuccin-vsc-storybook/package.json index dc013c7b..2d51da62 100644 --- a/packages/catppuccin-vsc-storybook/package.json +++ b/packages/catppuccin-vsc-storybook/package.json @@ -3,7 +3,7 @@ "license": "MIT", "private": true, "devDependencies": { - "@catppuccin/palette": "^1.1.1", + "@catppuccin/palette": "^1.7.1", "@fontsource/jetbrains-mono": "^5.0.20", "@storybook/addon-essentials": "^8.0.9", "@storybook/addon-styling": "^1.3.7", diff --git a/packages/catppuccin-vsc/package.json b/packages/catppuccin-vsc/package.json index 9c596ce2..037368f5 100644 --- a/packages/catppuccin-vsc/package.json +++ b/packages/catppuccin-vsc/package.json @@ -168,7 +168,7 @@ }, "devDependencies": { "@actions/core": "^1.10.1", - "@catppuccin/palette": "^1.1.1", + "@catppuccin/palette": "^1.7.1", "@catppuccin/vsc-typegen": "workspace:*", "@tsconfig/node18": "^18.2.4", "@types/node": "^20.12.7", diff --git a/packages/catppuccin-vsc/src/theme/index.ts b/packages/catppuccin-vsc/src/theme/index.ts index b5bf5552..bdc6e796 100644 --- a/packages/catppuccin-vsc/src/theme/index.ts +++ b/packages/catppuccin-vsc/src/theme/index.ts @@ -1,6 +1,7 @@ import { flavors } from "@catppuccin/palette"; import type { + CatppuccinPaletteAnsi, CatppuccinFlavor, CatppuccinPalette, ThemeContext, @@ -29,9 +30,17 @@ export const compileTheme = ( ) => { const flavorData = flavors[flavor]; const ctpPalette = {} as CatppuccinPalette; + const paletteAnsi = { + normal: {}, + bright: {}, + } as CatppuccinPaletteAnsi; for (const [k, v] of flavorData.colorEntries) { ctpPalette[k] = v.hex; } + for (const [k, v] of flavorData.ansiColorEntries) { + paletteAnsi.normal[k] = v.normal.hex; + paletteAnsi.bright[k] = v.bright.hex; + } const palette: CatppuccinPalette = { ...ctpPalette, @@ -42,6 +51,7 @@ export const compileTheme = ( const context: ThemeContext = { flavor, palette, + paletteAnsi, options, isLatte: flavor === "latte", }; diff --git a/packages/catppuccin-vsc/src/theme/uiColors.ts b/packages/catppuccin-vsc/src/theme/uiColors.ts index 553bc6f0..d0e71efc 100644 --- a/packages/catppuccin-vsc/src/theme/uiColors.ts +++ b/packages/catppuccin-vsc/src/theme/uiColors.ts @@ -6,7 +6,7 @@ import uiCustomizations from "./ui"; export const getUiColors = ( context: ThemeContext, ): Partial> => { - const { palette, options, isLatte } = context; + const { palette, paletteAnsi, options, isLatte } = context; const accent = palette[options.accent]; const dropBackground = opacity(accent, 0.2); @@ -437,22 +437,22 @@ export const getUiColors = ( // Terminal "terminal.foreground": palette.text, - "terminal.ansiBlack": isLatte ? palette.surface1 : palette.subtext0, // color0 - "terminal.ansiRed": palette.red, // color1 - "terminal.ansiGreen": palette.green, // color2 - "terminal.ansiYellow": palette.yellow, // color3 - "terminal.ansiBlue": palette.blue, // color4 - "terminal.ansiMagenta": palette.pink, // color5 - "terminal.ansiCyan": palette.sky, // color6 - "terminal.ansiWhite": isLatte ? palette.surface2 : palette.subtext1, // color7 - "terminal.ansiBrightBlack": isLatte ? palette.subtext0 : palette.surface2, // color8 - "terminal.ansiBrightRed": palette.red, // color9 - "terminal.ansiBrightGreen": palette.green, // color10 - "terminal.ansiBrightYellow": palette.yellow, // color11 - "terminal.ansiBrightBlue": palette.blue, // color12 - "terminal.ansiBrightMagenta": palette.pink, // color13 - "terminal.ansiBrightCyan": palette.sky, // color14 - "terminal.ansiBrightWhite": isLatte ? palette.subtext1 : palette.surface1, // color15 + "terminal.ansiBlack": paletteAnsi.normal.black, // color0 + "terminal.ansiRed": paletteAnsi.normal.red, // color1 + "terminal.ansiGreen": paletteAnsi.normal.green, // color2 + "terminal.ansiYellow": paletteAnsi.normal.yellow, // color3 + "terminal.ansiBlue": paletteAnsi.normal.blue, // color4 + "terminal.ansiMagenta": paletteAnsi.normal.magenta, // color5 + "terminal.ansiCyan": paletteAnsi.normal.cyan, // color6 + "terminal.ansiWhite": paletteAnsi.normal.white, // color7 + "terminal.ansiBrightBlack": paletteAnsi.bright.black, // color8 + "terminal.ansiBrightRed": paletteAnsi.bright.red, // color9 + "terminal.ansiBrightGreen": paletteAnsi.bright.green, // color10 + "terminal.ansiBrightYellow": paletteAnsi.bright.yellow, // color11 + "terminal.ansiBrightBlue": paletteAnsi.bright.blue, // color12 + "terminal.ansiBrightMagenta": paletteAnsi.bright.magenta, // color13 + "terminal.ansiBrightCyan": paletteAnsi.bright.cyan, // color14 + "terminal.ansiBrightWhite": paletteAnsi.bright.white, // color15 "terminal.selectionBackground": palette.surface2, "terminal.inactiveSelectionBackground": opacity(palette.surface2, 0.5), "terminalCursor.background": palette.base, diff --git a/packages/catppuccin-vsc/src/types/index.d.ts b/packages/catppuccin-vsc/src/types/index.d.ts index e2f024ff..9ebd6b4c 100644 --- a/packages/catppuccin-vsc/src/types/index.d.ts +++ b/packages/catppuccin-vsc/src/types/index.d.ts @@ -1,4 +1,9 @@ -import type { AccentName, Colors, FlavorName } from "@catppuccin/palette"; +import type { + AccentName, + Colors, + AnsiColors, + FlavorName, +} from "@catppuccin/palette"; import type { Uri } from "vscode"; @@ -23,6 +28,10 @@ export type CatppuccinBracketMode = | "neovim"; export type CatppuccinPalette = Colors; +export type CatppuccinPaletteAnsi = { + normal: AnsiColors; + bright: AnsiColors; +}; type FlavorsPlusAll = { all: T } & { [k in CatppuccinFlavor]: T }; @@ -78,6 +87,7 @@ export type ThemePaths = { export type ThemeContext = { flavor: CatppuccinFlavor; palette: CatppuccinPalette; + paletteAnsi: CatppuccinPaletteAnsi; options: ThemeOptions; isLatte: boolean; }; diff --git a/packages/catppuccin-vscode/package.json b/packages/catppuccin-vscode/package.json index 5fa3e95a..a5e68dc2 100644 --- a/packages/catppuccin-vscode/package.json +++ b/packages/catppuccin-vscode/package.json @@ -32,7 +32,7 @@ } }, "dependencies": { - "@catppuccin/palette": "^1.1.1" + "@catppuccin/palette": "^1.7.1" }, "devDependencies": { "@tsconfig/node20": "^20.1.4", diff --git a/yarn.lock b/yarn.lock index 29476367..9e11fabf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1608,10 +1608,10 @@ __metadata: languageName: node linkType: hard -"@catppuccin/palette@npm:^1.1.1": - version: 1.1.1 - resolution: "@catppuccin/palette@npm:1.1.1" - checksum: 10c0/ed913c512b4f51166c8a9041977a20a47095c76176e3e0cb87083816a7a3bbcc24e681ffcd431638833c55d95598afb909ffcdc5875e6a0df30e7856117284bf +"@catppuccin/palette@npm:^1.7.1": + version: 1.7.1 + resolution: "@catppuccin/palette@npm:1.7.1" + checksum: 10c0/b4577ad742310ccfd3394791be96ef8787fc6c3e90c7b9ca6dfbe12fb5e63ad8c7d1627846df4744b8edaee19ed98a2c34a292dc5e4ae8a3e877c5afafcc62d2 languageName: node linkType: hard @@ -1619,7 +1619,7 @@ __metadata: version: 0.0.0-use.local resolution: "@catppuccin/vsc-storybook@workspace:packages/catppuccin-vsc-storybook" dependencies: - "@catppuccin/palette": "npm:^1.1.1" + "@catppuccin/palette": "npm:^1.7.1" "@fontsource/jetbrains-mono": "npm:^5.0.20" "@storybook/addon-essentials": "npm:^8.0.9" "@storybook/addon-styling": "npm:^1.3.7" @@ -1681,7 +1681,7 @@ __metadata: version: 0.0.0-use.local resolution: "@catppuccin/vscode@workspace:packages/catppuccin-vscode" dependencies: - "@catppuccin/palette": "npm:^1.1.1" + "@catppuccin/palette": "npm:^1.7.1" "@tsconfig/node20": "npm:^20.1.4" "@types/node": "npm:^20.12.7" catppuccin-vsc: "workspace:*" @@ -5413,7 +5413,7 @@ __metadata: resolution: "catppuccin-vsc@workspace:packages/catppuccin-vsc" dependencies: "@actions/core": "npm:^1.10.1" - "@catppuccin/palette": "npm:^1.1.1" + "@catppuccin/palette": "npm:^1.7.1" "@catppuccin/vsc-typegen": "workspace:*" "@tsconfig/node18": "npm:^18.2.4" "@types/node": "npm:^20.12.7"