Skip to content

Instantly share code, notes, and snippets.

@shuhei
Created January 9, 2017 21:19
Show Gist options
  • Save shuhei/4e84504805074a8a7d9ce71dd557aa33 to your computer and use it in GitHub Desktop.
Save shuhei/4e84504805074a8a7d9ce71dd557aa33 to your computer and use it in GitHub Desktop.
Dracula color scheme for Alacritty
# Colors (Dracula)
colors:
# Default colors
primary:
background: '0x282a36'
foreground: '0xf8f8f2'
# Normal colors
normal:
black: '0x000000'
red: '0xff5555'
green: '0x50fa7b'
yellow: '0xf1fa8c'
blue: '0xcaa9fa'
magenta: '0xff79c6'
cyan: '0x8be9fd'
white: '0xbfbfbf'
# Bright colors
bright:
black: '0x282a35'
red: '0xff6e67'
green: '0x5af78e'
yellow: '0xf4f99d'
blue: '0xcaa9fa'
magenta: '0xff92d0'
cyan: '0x9aedfe'
white: '0xe6e6e6'
// https://github.com/dracula/mintty/blob/master/.minttyrc.dracula
const text = `ForegroundColour=248,248,242
BackgroundColour=40,42,54
Black=0,0,0
BoldBlack=40,42,53
Red=255,85,85
BoldRed=255,110,103
Green=80,250,123
BoldGreen=90,247,142
Yellow=241,250,140
BoldYellow=244,249,157
Blue=202,169,250
BoldBlue=202,169,250
Magenta=255,121,198
BoldMagenta=255,146,208
Cyan=139,233,253
BoldCyan=154,237,254
White=191,191,191
BoldWhite=230,230,230`;
const lines = text.split('\n');
lines.forEach((line) => {
const [name, rgb] = line.split('=');
const [red, green, blue] = rgb.split(',').map(s => parseInt(s, 10));
const formatted = `${name}: 0x${toHex(red)}${toHex(green)}${toHex(blue)}`;
console.log(formatted);
});
function toHex(n) {
const hex = n.toString(16);
if (hex.length === 1) {
return '0' + hex;
} else {
return hex;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment