From 2b972ca1cce1633aa94891c1a24dcf6a54eda6bc Mon Sep 17 00:00:00 2001
From: Runxi Yu <me@runxiyu.org>
Date: Mon, 10 Feb 2025 15:02:06 +0800
Subject: [PATCH] repo_tree: Attempt to use the xcode theme

---
 handle_repo_tree.go |   2 +-
 static/chroma.css   | 101 ++++++++++++++++++++++++++++++++---------------------

diff --git a/handle_repo_tree.go b/handle_repo_tree.go
index c2810d93329ed49d6a3bde65c8f08ed8635b2c75..1a2c8103d97234f0c4507725f7d736811bcf6838 100644
--- a/handle_repo_tree.go
+++ b/handle_repo_tree.go
@@ -81,7 +81,7 @@ 			_, _ = w.Write([]byte("Error rendering code: " + err.Error()))
 			return
 		}
 		var formatted_unencapsulated bytes.Buffer
-		style := chroma_styles.Get("emacs")
+		style := chroma_styles.Get("xcode")
 		formatter := chroma_formatters_html.New(chroma_formatters_html.WithClasses(true), chroma_formatters_html.TabWidth(8))
 		formatter.Format(&formatted_unencapsulated, style, iterator)
 		formatted_encapsulated := template.HTML(formatted_unencapsulated.Bytes())
diff --git a/static/chroma.css b/static/chroma.css
index 0898db3ecaabe2f2d1139d84a3bdd65a4c9923f1..3a0ea85c28e05eb0ae1bc2241978286ae8863c74 100644
--- a/static/chroma.css
+++ b/static/chroma.css
@@ -1,6 +1,6 @@
 /* Background */ .bg { background-color: #ffffff; }
 /* PreWrapper */ .chroma { background-color: #ffffff; }
-/* Error */ .chroma .err {  }
+/* Error */ .chroma .err { color: #000000 }
 /* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit }
 /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
 /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
@@ -8,42 +8,63 @@ /* LineHighlight */ .chroma .hl { background-color: #e5e5e5 }
 /* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
 /* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
 /* Line */ .chroma .line { display: flex; }
-/* Keyword */ .chroma .k { font-weight: bold }
-/* KeywordConstant */ .chroma .kc { font-weight: bold }
-/* KeywordDeclaration */ .chroma .kd { font-weight: bold }
-/* KeywordNamespace */ .chroma .kn { font-weight: bold }
-/* KeywordPseudo */ .chroma .kp {  }
-/* KeywordReserved */ .chroma .kr { font-weight: bold }
-/* KeywordType */ .chroma .kt {  }
-/* NameClass */ .chroma .nc { font-weight: bold }
-/* NameEntity */ .chroma .ni { font-weight: bold }
-/* NameException */ .chroma .ne { font-weight: bold }
-/* NameNamespace */ .chroma .nn { font-weight: bold }
-/* NameTag */ .chroma .nt { font-weight: bold }
-/* LiteralString */ .chroma .s { font-style: italic }
-/* LiteralStringAffix */ .chroma .sa { font-style: italic }
-/* LiteralStringBacktick */ .chroma .sb { font-style: italic }
-/* LiteralStringChar */ .chroma .sc { font-style: italic }
-/* LiteralStringDelimiter */ .chroma .dl { font-style: italic }
-/* LiteralStringDoc */ .chroma .sd { font-style: italic }
-/* LiteralStringDouble */ .chroma .s2 { font-style: italic }
-/* LiteralStringEscape */ .chroma .se { font-weight: bold; font-style: italic }
-/* LiteralStringHeredoc */ .chroma .sh { font-style: italic }
-/* LiteralStringInterpol */ .chroma .si { font-weight: bold; font-style: italic }
-/* LiteralStringOther */ .chroma .sx { font-style: italic }
-/* LiteralStringRegex */ .chroma .sr { font-style: italic }
-/* LiteralStringSingle */ .chroma .s1 { font-style: italic }
-/* LiteralStringSymbol */ .chroma .ss { font-style: italic }
-/* OperatorWord */ .chroma .ow { font-weight: bold }
-/* Comment */ .chroma .c { font-style: italic }
-/* CommentHashbang */ .chroma .ch { font-style: italic }
-/* CommentMultiline */ .chroma .cm { font-style: italic }
-/* CommentSingle */ .chroma .c1 { font-style: italic }
-/* CommentSpecial */ .chroma .cs { font-style: italic }
-/* CommentPreproc */ .chroma .cp {  }
-/* CommentPreprocFile */ .chroma .cpf {  }
-/* GenericEmph */ .chroma .ge { font-style: italic }
-/* GenericHeading */ .chroma .gh { font-weight: bold }
-/* GenericPrompt */ .chroma .gp { font-weight: bold }
-/* GenericStrong */ .chroma .gs { font-weight: bold }
-/* GenericSubheading */ .chroma .gu { font-weight: bold }
+/* Keyword */ .chroma .k { color: #a90d91 }
+/* KeywordConstant */ .chroma .kc { color: #a90d91 }
+/* KeywordDeclaration */ .chroma .kd { color: #a90d91 }
+/* KeywordNamespace */ .chroma .kn { color: #a90d91 }
+/* KeywordPseudo */ .chroma .kp { color: #a90d91 }
+/* KeywordReserved */ .chroma .kr { color: #a90d91 }
+/* KeywordType */ .chroma .kt { color: #a90d91 }
+/* Name */ .chroma .n { color: #000000 }
+/* NameAttribute */ .chroma .na { color: #836c28 }
+/* NameBuiltin */ .chroma .nb { color: #a90d91 }
+/* NameBuiltinPseudo */ .chroma .bp { color: #5b269a }
+/* NameClass */ .chroma .nc { color: #3f6e75 }
+/* NameConstant */ .chroma .no { color: #000000 }
+/* NameDecorator */ .chroma .nd { color: #000000 }
+/* NameEntity */ .chroma .ni { color: #000000 }
+/* NameException */ .chroma .ne { color: #000000 }
+/* NameFunction */ .chroma .nf { color: #000000 }
+/* NameFunctionMagic */ .chroma .fm { color: #000000 }
+/* NameLabel */ .chroma .nl { color: #000000 }
+/* NameNamespace */ .chroma .nn { color: #000000 }
+/* NameOther */ .chroma .nx { color: #000000 }
+/* NameProperty */ .chroma .py { color: #000000 }
+/* NameTag */ .chroma .nt { color: #000000 }
+/* NameVariable */ .chroma .nv { color: #000000 }
+/* NameVariableClass */ .chroma .vc { color: #000000 }
+/* NameVariableGlobal */ .chroma .vg { color: #000000 }
+/* NameVariableInstance */ .chroma .vi { color: #000000 }
+/* NameVariableMagic */ .chroma .vm { color: #000000 }
+/* Literal */ .chroma .l { color: #1c01ce }
+/* LiteralDate */ .chroma .ld { color: #1c01ce }
+/* LiteralString */ .chroma .s { color: #c41a16 }
+/* LiteralStringAffix */ .chroma .sa { color: #c41a16 }
+/* LiteralStringBacktick */ .chroma .sb { color: #c41a16 }
+/* LiteralStringChar */ .chroma .sc { color: #2300ce }
+/* LiteralStringDelimiter */ .chroma .dl { color: #c41a16 }
+/* LiteralStringDoc */ .chroma .sd { color: #c41a16 }
+/* LiteralStringDouble */ .chroma .s2 { color: #c41a16 }
+/* LiteralStringEscape */ .chroma .se { color: #c41a16 }
+/* LiteralStringHeredoc */ .chroma .sh { color: #c41a16 }
+/* LiteralStringInterpol */ .chroma .si { color: #c41a16 }
+/* LiteralStringOther */ .chroma .sx { color: #c41a16 }
+/* LiteralStringRegex */ .chroma .sr { color: #c41a16 }
+/* LiteralStringSingle */ .chroma .s1 { color: #c41a16 }
+/* LiteralStringSymbol */ .chroma .ss { color: #c41a16 }
+/* LiteralNumber */ .chroma .m { color: #1c01ce }
+/* LiteralNumberBin */ .chroma .mb { color: #1c01ce }
+/* LiteralNumberFloat */ .chroma .mf { color: #1c01ce }
+/* LiteralNumberHex */ .chroma .mh { color: #1c01ce }
+/* LiteralNumberInteger */ .chroma .mi { color: #1c01ce }
+/* LiteralNumberIntegerLong */ .chroma .il { color: #1c01ce }
+/* LiteralNumberOct */ .chroma .mo { color: #1c01ce }
+/* Operator */ .chroma .o { color: #000000 }
+/* OperatorWord */ .chroma .ow { color: #000000 }
+/* Comment */ .chroma .c { color: #177500 }
+/* CommentHashbang */ .chroma .ch { color: #177500 }
+/* CommentMultiline */ .chroma .cm { color: #177500 }
+/* CommentSingle */ .chroma .c1 { color: #177500 }
+/* CommentSpecial */ .chroma .cs { color: #177500 }
+/* CommentPreproc */ .chroma .cp { color: #633820 }
+/* CommentPreprocFile */ .chroma .cpf { color: #633820 }

-- 
2.48.1