Skip to content

Commit

Permalink
feat: add catpuccin themes
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <[email protected]>
  • Loading branch information
ghivert committed Apr 26, 2024
1 parent 7a269fa commit ef98c6c
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 11 deletions.
6 changes: 3 additions & 3 deletions gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ target = "javascript"
version = "0.1.0"

description = "Time traveller debugger, tailor-made for Lustre"
licences = ["MIT"]
# links = [{title = "Website", href = "https://gleam.run"}]
internal_modules = ["tardis/internals", "tardis/internals/*"]
licences = ["MIT"]
links = [{title = "Sponsor", href = "https://github.com/sponsors/ghivert"}]
repository = {type = "github", user = "ghivert", repo = "tardis"}

[dependencies]
gleam_stdlib = ">= 0.36.0 and < 1.0.0"
lustre = ">= 4.1.8 and < 5.0.0"
lustre = ">= 4.2.0 and < 5.0.0"
plinth = ">= 0.2.0 and < 1.0.0"
sketch = ">= 2.0.0 and < 3.0.0"

Expand Down
14 changes: 7 additions & 7 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
packages = [
{ name = "gleam_erlang", version = "0.25.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "054D571A7092D2A9727B3E5D183B7507DAB0DA41556EC9133606F09C15497373" },
{ name = "gleam_javascript", version = "0.8.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_javascript", source = "hex", outer_checksum = "14D5B7E1A70681E0776BF0A0357F575B822167960C844D3D3FA114D3A75F05A8" },
{ name = "gleam_json", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "8B197DD5D578EA6AC2C0D4BDC634C71A5BCA8E7DB5F47091C263ECB411A60DF3" },
{ name = "gleam_json", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "9063D14D25406326C0255BDA0021541E797D8A7A12573D849462CAFED459F6EB" },
{ name = "gleam_otp", version = "0.10.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "0B04FE915ACECE539B317F9652CAADBBC0F000184D586AAAF2D94C100945D72B" },
{ name = "gleam_stdlib", version = "0.36.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "C0D14D807FEC6F8A08A7C9EF8DFDE6AE5C10E40E21325B2B29365965D82EB3D4" },
{ name = "gleam_stdlib", version = "0.37.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "5398BD6C2ABA17338F676F42F404B9B7BABE1C8DC7380031ACB05BBE1BCF3742" },
{ name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" },
{ name = "lustre", version = "4.1.8", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "55C3D26AEE6BF6B859927616B1F5BC25841926E4EA6A2A72ECC90D6769560F04" },
{ name = "lustre", version = "4.2.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "258F876CD7AB12C2C773F1A30F76DFC0A0ED989B720070DF32FC0717A6A0E60C" },
{ name = "plinth", version = "0.2.0", build_tools = ["gleam"], requirements = ["gleam_javascript", "gleam_json", "gleam_stdlib"], otp_app = "plinth", source = "hex", outer_checksum = "83211E672D83F3CE14681D0ECD3AD883EE7588E423E7C9DDDB460014AD60AC24" },
{ name = "sketch", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "lustre", "plinth"], otp_app = "sketch", source = "hex", outer_checksum = "2FE8458F79F2A92267A70F9230151A92038554C19C6948B01B7EAAE0B888B9BB" },
{ name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" },
{ name = "sketch", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "lustre", "plinth"], otp_app = "sketch", source = "hex", outer_checksum = "47175BD019A00CFEAAF2851830825544E24ABA58168083A1D219FA8E06EF6713" },
{ name = "thoas", version = "1.2.0", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "540C8CB7D9257F2AD0A14145DC23560F91ACDCA995F0CCBA779EB33AF5D859D1" },
]

[requirements]
gleam_stdlib = { version = ">= 0.36.0 and < 1.0.0" }
gleeunit = { version = ">= 1.1.2 and < 2.0.0"}
lustre = { version = ">= 4.1.8 and < 5.0.0" }
gleeunit = { version = ">= 1.1.2 and < 2.0.0" }
lustre = { version = ">= 4.2.0 and < 5.0.0" }
plinth = { version = ">= 0.2.0 and < 1.0.0" }
sketch = { version = ">= 2.0.0 and < 3.0.0" }
104 changes: 103 additions & 1 deletion src/tardis/internals/data/colors.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ pub type Colors {
pub type ColorScheme {
AyuDark
AyuLight
CatpuccinLight
CatpuccinFrappe
Gleam
}

pub fn cs_to_string(color_scheme) {
case color_scheme {
AyuDark -> "Ayu Dark"
AyuLight -> "Ayu Light"
CatpuccinLight -> "Catpuccin Light"
CatpuccinFrappe -> "Catpuccin Frappé"
Gleam -> "Gleam"
}
}
Expand All @@ -47,13 +51,15 @@ pub fn cs_from_string(key) {
case key {
"Ayu Dark" -> AyuDark
"Ayu Light" -> AyuLight
"Catpuccin Light" -> CatpuccinLight
"Catpuccin Frappé" -> CatpuccinFrappe
"Gleam" -> Gleam
_ -> Gleam
}
}

pub fn themes() {
[AyuDark, AyuLight, Gleam]
[AyuDark, AyuLight, CatpuccinLight, CatpuccinFrappe, Gleam]
}

pub const ayu_dark = Colors(
Expand Down Expand Up @@ -100,6 +106,50 @@ pub const ayu_light = Colors(
date: "#a37acc",
)

pub const catpuccin_light = Colors(
background: "#e6e9ef",
shadow: "#dce0e8",
primary: "#dc8a78",
editor_fg: "#4c4f69",
editor_bg: "#eff1f5",
gutter: "#dce0e8",
syntax_comment: "#6c6f85",
button: "#dd7878",
function: "#ea76cb",
nil: "#8839ef",
bool: "#d20f39",
constant: "#8839ef",
bit_array: "#40a02b",
utf_codepoint: "#fe640b",
string: "#40a02b",
number: "#04a5e5",
custom_type: "#7287fd",
regex: "#179299",
date: "#d20f39",
)

pub const catpuccin_frappe = Colors(
background: "#292c3c",
shadow: "#232634",
primary: "#f2d5cf",
editor_fg: "#c6d0f5",
editor_bg: "#303446",
gutter: "#232634",
syntax_comment: "#a5adce",
button: "#eebebe",
function: "#f4b8e4",
nil: "#ca9ee6",
bool: "#e78284",
constant: "#ca9ee6",
bit_array: "#a6d189",
utf_codepoint: "#ef9f76",
string: "#a6d189",
number: "#99d1db",
custom_type: "#babbf1",
regex: "#81c8be",
date: "#e78284",
)

pub const gleam = Colors(
background: "#2f2f2f",
shadow: "#2f2f2f",
Expand Down Expand Up @@ -172,6 +222,56 @@ pub fn ayu_light_class() {
|> sketch.to_lustre()
}

pub fn catpuccin_light_class() {
sketch.class([
sketch.property("--background", catpuccin_light.background),
sketch.property("--shadow", catpuccin_light.shadow),
sketch.property("--primary", catpuccin_light.primary),
sketch.property("--editor-fg", catpuccin_light.editor_fg),
sketch.property("--editor-bg", catpuccin_light.editor_bg),
sketch.property("--gutter", catpuccin_light.gutter),
sketch.property("--syntax-comment", catpuccin_light.syntax_comment),
sketch.property("--button", catpuccin_light.button),
sketch.property("--function", catpuccin_light.function),
sketch.property("--nil", catpuccin_light.nil),
sketch.property("--bool", catpuccin_light.bool),
sketch.property("--constant", catpuccin_light.constant),
sketch.property("--bit-array", catpuccin_light.bit_array),
sketch.property("--utfcodepoint", catpuccin_light.utf_codepoint),
sketch.property("--string", catpuccin_light.string),
sketch.property("--number", catpuccin_light.number),
sketch.property("--custom-type", catpuccin_light.custom_type),
sketch.property("--regex", catpuccin_light.regex),
sketch.property("--date", catpuccin_light.date),
])
|> sketch.to_lustre()
}

pub fn catpuccin_frappe_class() {
sketch.class([
sketch.property("--background", catpuccin_frappe.background),
sketch.property("--shadow", catpuccin_frappe.shadow),
sketch.property("--primary", catpuccin_frappe.primary),
sketch.property("--editor-fg", catpuccin_frappe.editor_fg),
sketch.property("--editor-bg", catpuccin_frappe.editor_bg),
sketch.property("--gutter", catpuccin_frappe.gutter),
sketch.property("--syntax-comment", catpuccin_frappe.syntax_comment),
sketch.property("--button", catpuccin_frappe.button),
sketch.property("--function", catpuccin_frappe.function),
sketch.property("--nil", catpuccin_frappe.nil),
sketch.property("--bool", catpuccin_frappe.bool),
sketch.property("--constant", catpuccin_frappe.constant),
sketch.property("--bit-array", catpuccin_frappe.bit_array),
sketch.property("--utfcodepoint", catpuccin_frappe.utf_codepoint),
sketch.property("--string", catpuccin_frappe.string),
sketch.property("--number", catpuccin_frappe.number),
sketch.property("--custom-type", catpuccin_frappe.custom_type),
sketch.property("--regex", catpuccin_frappe.regex),
sketch.property("--date", catpuccin_frappe.date),
])
|> sketch.to_lustre()
}

pub fn gleam_class() {
sketch.class([
sketch.property("--background", gleam.background),
Expand Down Expand Up @@ -218,6 +318,8 @@ pub fn get_color_scheme_class(color_scheme: ColorScheme) {
case color_scheme {
AyuLight -> ayu_light_class()
AyuDark -> ayu_dark_class()
CatpuccinLight -> catpuccin_light_class()
CatpuccinFrappe -> catpuccin_frappe_class()
Gleam -> gleam_class()
}
}

0 comments on commit ef98c6c

Please sign in to comment.