Skip to content

Commit 0d3b1db

Browse files
authored
feat: add rich integration (#17)
1 parent 4f9dae0 commit 0d3b1db

File tree

3 files changed

+380
-278
lines changed

3 files changed

+380
-278
lines changed

catppuccin/extras/rich_ctp.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from rich.theme import Theme
2+
3+
from catppuccin.flavour import Flavour
4+
5+
6+
def _make_theme(flavour: Flavour) -> Theme:
7+
return Theme(
8+
{
9+
"rosewater": f"#{flavour.rosewater.hex}",
10+
"flamingo": f"#{flavour.flamingo.hex}",
11+
"pink": f"#{flavour.pink.hex}",
12+
"mauve": f"#{flavour.mauve.hex}",
13+
"red": f"#{flavour.red.hex}",
14+
"maroon": f"#{flavour.maroon.hex}",
15+
"peach": f"#{flavour.peach.hex}",
16+
"yellow": f"#{flavour.yellow.hex}",
17+
"green": f"#{flavour.green.hex}",
18+
"teal": f"#{flavour.teal.hex}",
19+
"sky": f"#{flavour.sky.hex}",
20+
"sapphire": f"#{flavour.sapphire.hex}",
21+
"blue": f"#{flavour.blue.hex}",
22+
"lavender": f"#{flavour.lavender.hex}",
23+
"text": f"#{flavour.text.hex}",
24+
"subtext1": f"#{flavour.subtext1.hex}",
25+
"subtext0": f"#{flavour.subtext0.hex}",
26+
"overlay2": f"#{flavour.overlay2.hex}",
27+
"overlay1": f"#{flavour.overlay1.hex}",
28+
"overlay0": f"#{flavour.overlay0.hex}",
29+
"surface2": f"#{flavour.surface2.hex}",
30+
"surface1": f"#{flavour.surface1.hex}",
31+
"surface0": f"#{flavour.surface0.hex}",
32+
"base": f"#{flavour.base.hex}",
33+
"mantle": f"#{flavour.mantle.hex}",
34+
"crust": f"#{flavour.crust.hex}",
35+
}
36+
)
37+
38+
39+
latte = _make_theme(Flavour.latte())
40+
frappe = _make_theme(Flavour.frappe())
41+
macchiato = _make_theme(Flavour.macchiato())
42+
mocha = _make_theme(Flavour.mocha())

0 commit comments

Comments
 (0)