Skip to content

Commit

Permalink
Add more colors
Browse files Browse the repository at this point in the history
  • Loading branch information
pomber committed Feb 15, 2023
1 parent 0c906d2 commit 06459bf
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/three-suns-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@code-hike/lighter": patch
---

Add more colors
8 changes: 8 additions & 0 deletions lib/dist/index.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions lib/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ declare function getThemeColors(theme: FinalTheme): {
listSelectionForeground: string;
listHoverBackground: string;
listHoverForeground: string;
tabsBorder: string;
activeTabTopBorder: string;
hoverTabBackground: string;
hoverTabForeground: string;
colorScheme: "dark" | "light";
};

Expand Down Expand Up @@ -143,6 +147,10 @@ declare function highlight(code: string, alias: LanguageAlias, themeOrThemeName?
listSelectionForeground: string;
listHoverBackground: string;
listHoverForeground: string;
tabsBorder: string;
activeTabTopBorder: string;
hoverTabBackground: string;
hoverTabForeground: string;
colorScheme: "dark" | "light";
};
}>;
Expand Down Expand Up @@ -178,6 +186,10 @@ declare function annotatedHighlight(code: string, alias: LanguageAlias, themeOrT
listSelectionForeground: string;
listHoverBackground: string;
listHoverForeground: string;
tabsBorder: string;
activeTabTopBorder: string;
hoverTabBackground: string;
hoverTabForeground: string;
colorScheme: "dark" | "light";
};
}>;
Expand Down
8 changes: 8 additions & 0 deletions lib/dist/index.esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ const colorNamesToKeys = {
listSelectionForeground: "list.inactiveSelectionForeground",
listHoverBackground: "list.hoverBackground",
listHoverForeground: "list.hoverForeground",
tabsBorder: "editorGroupHeader.tabsBorder",
activeTabTopBorder: "tab.activeBorderTop",
hoverTabBackground: "tab.hoverBackground",
hoverTabForeground: "tab.hoverForeground",
};
function getColors(theme) {
const colors = {};
Expand Down Expand Up @@ -568,6 +572,10 @@ const defaults = {
"list.inactiveSelectionForeground": { dark: undefined, light: undefined },
"list.hoverBackground": { dark: "#2A2D2E", light: "#F0F0F0" },
"list.hoverForeground": { dark: undefined, light: undefined },
"editorGroupHeader.tabsBorder": { hc: contrastBorder },
"tab.activeBorderTop": { hc: contrastBorder },
"tab.hoverBackground": "tab.inactiveBackground",
"tab.hoverForeground": "tab.inactiveForeground",
};

async function loadTheme(theme) {
Expand Down
8 changes: 8 additions & 0 deletions lib/src/theme-colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const colorNamesToKeys = {
listSelectionForeground: "list.inactiveSelectionForeground",
listHoverBackground: "list.hoverBackground",
listHoverForeground: "list.hoverForeground",
tabsBorder: "editorGroupHeader.tabsBorder",
activeTabTopBorder: "tab.activeBorderTop",
hoverTabBackground: "tab.hoverBackground",
hoverTabForeground: "tab.hoverForeground",
};

function getColors(theme: FinalTheme) {
Expand Down Expand Up @@ -142,4 +146,8 @@ const defaults = {
"list.inactiveSelectionForeground": { dark: undefined, light: undefined },
"list.hoverBackground": { dark: "#2A2D2E", light: "#F0F0F0" },
"list.hoverForeground": { dark: undefined, light: undefined },
"editorGroupHeader.tabsBorder": { hc: contrastBorder },
"tab.activeBorderTop": { hc: contrastBorder },
"tab.hoverBackground": "tab.inactiveBackground",
"tab.hoverForeground": "tab.inactiveForeground",
};
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function run() {

const result = await annotatedHighlight(newCode, alias, theme, annotations);
// console.log(JSON.stringify(result.lines));
console.log(JSON.stringify(result.lines, null, 1));
console.log(JSON.stringify(result.colors, null, 1));
}

run();

1 comment on commit 06459bf

@vercel
Copy link

@vercel vercel bot commented on 06459bf Feb 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lighter – ./

lighter-git-main-codehike.vercel.app
lighter-codehike.vercel.app
lighter.codehike.org

Please sign in to comment.