Skip to content

Instantly share code, notes, and snippets.

@TobiaszCudnik
Created September 4, 2022 18:10
Show Gist options
  • Save TobiaszCudnik/8b5cc781a58750f96b919807541066a6 to your computer and use it in GitHub Desktop.
Save TobiaszCudnik/8b5cc781a58750f96b919807541066a6 to your computer and use it in GitHub Desktop.
blink theme
var lightScheme = {
cursor: "rgba(146, 146, 146, 0.5)", // #929292
foreground: "#000000",
background: "#FFFFFF",
normalBlack: "#000000",
normalRed: "#FC2025",
normalGreen: "#29C732",
normalYellow: "#FC820A",
normalBlue: "#0B5FFE",
normalMagenta: "#463BCC",
normalCyan: "#47AFEC",
normalWhite: "#A9A9A9",
brightBlack: "#545454",
brightRed: "#FC0D44",
brightGreen: "#17BDB0",
brightYellow: "#FDC30A",
brightBlue: "#4A9DB7",
brightMagenta: "#9E33D6",
brightCyan: "#47AFEC",
brightWhite: "#FFFFFF"
};
var darkScheme = {
cursor: "rgba(96, 96, 96, 0.5)", // #606060
foreground: "#FFFFFF",
background: "#000000",
normalBlack: "#000000",
normalRed: "#FB2C2D",
normalGreen: "#2FD43B",
normalYellow: "#FD8D0E",
normalBlue: "#106BFF",
normalMagenta: "#4B41E0",
normalCyan: "#4CBBF2",
normalWhite: "#A9A9A9",
brightBlack: "#545454",
brightRed: "#FC194D",
brightGreen: "#56E2DB",
brightYellow: "#FFCF0E",
brightBlue: "#5AB8D4",
brightMagenta: "#B039EE",
brightCyan: "#4CBBF2",
brightWhite: "#FFFFFF"
};
var defaultScheme = lightScheme;
function setPreferredScheme() {
var preferredScheme = defaultScheme;
if (window.matchMedia) {
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
preferredScheme = darkScheme;
}
else {
preferredScheme = lightScheme;
}
}
t.prefs_.set("cursor-color", preferredScheme.cursor);
t.prefs_.set("foreground-color", preferredScheme.foreground);
t.prefs_.set("background-color", preferredScheme.background);
t.prefs_.set("color-palette-overrides", [
preferredScheme.normalBlack,
preferredScheme.normalRed,
preferredScheme.normalGreen,
preferredScheme.normalYellow,
preferredScheme.normalBlue,
preferredScheme.normalMagenta,
preferredScheme.normalCyan,
preferredScheme.normalWhite,
preferredScheme.brightBlack,
preferredScheme.brightRed,
preferredScheme.brightGreen,
preferredScheme.brightYellow,
preferredScheme.brightBlue,
preferredScheme.brightMagenta,
preferredScheme.brightCyan,
preferredScheme.brightWhite
]);
}
if (window.matchMedia) {
window
.matchMedia("(prefers-color-scheme: dark)")
.addEventListener("change", setPreferredScheme);
}
setPreferredScheme();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment