Skip to content

Commit 2223be2

Browse files
authored
Support blue yellow colorblind theme (#35910)
This icon is from GitHub: <img width="350" height="350" alt="image" src="https://github.com/user-attachments/assets/c3f31901-5359-4b7f-ae68-eddcec63df53" /> --------- Signed-off-by: 鲁汀 <131967983+lutinglt@users.noreply.github.com> Co-authored-by: lutinglt <lutinglt@users.noreply.github.com>
1 parent 9affb51 commit 2223be2

File tree

6 files changed

+58
-0
lines changed

6 files changed

+58
-0
lines changed

public/assets/img/svg/gitea-colorblind-blueyellow.svg

Lines changed: 1 addition & 0 deletions
Loading

services/webtheme/webtheme.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ func (info *ThemeMetaInfo) GetDescription() string {
3939
if info.ColorblindType == "red-green" {
4040
return "Red-green colorblind friendly"
4141
}
42+
if info.ColorblindType == "blue-yellow" {
43+
return "Blue-yellow colorblind friendly"
44+
}
4245
return ""
4346
}
4447

4548
func (info *ThemeMetaInfo) GetExtraIconName() string {
4649
if info.ColorblindType == "red-green" {
4750
return "gitea-colorblind-redgreen"
4851
}
52+
if info.ColorblindType == "blue-yellow" {
53+
return "gitea-colorblind-blueyellow"
54+
}
4955
return ""
5056
}
5157

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@import "./theme-gitea-light-tritanopia.css" (prefers-color-scheme: light);
2+
@import "./theme-gitea-dark-tritanopia.css" (prefers-color-scheme: dark);
3+
4+
gitea-theme-meta-info {
5+
--theme-display-name: "Auto";
6+
--theme-colorblind-type: "blue-yellow";
7+
--theme-color-scheme: "auto";
8+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@import "./theme-gitea-dark-protanopia-deuteranopia.css";
2+
3+
gitea-theme-meta-info {
4+
--theme-display-name: "Dark";
5+
--theme-colorblind-type: "blue-yellow";
6+
--theme-color-scheme: "dark";
7+
}
8+
9+
/* blue/yellow colorblind-friendly colors */
10+
/* from GitHub: blue yellow blindness is based on red green blindness, and --diffBlob-deletion-* restored to the normal theme color */
11+
:root {
12+
--color-diff-removed-linenum-bg: #482121;
13+
--color-diff-removed-row-bg: #301e1e;
14+
--color-diff-removed-word-bg: #6f3333;
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@import "./theme-gitea-light-protanopia-deuteranopia.css";
2+
3+
gitea-theme-meta-info {
4+
--theme-display-name: "Light";
5+
--theme-colorblind-type: "blue-yellow";
6+
--theme-color-scheme: "light";
7+
}
8+
9+
/* blue/yellow colorblind-friendly colors */
10+
/* from GitHub: blue yellow blindness is based on red green blindness, and --diffBlob-deletion-* restored to the normal theme color */
11+
:root {
12+
--color-diff-removed-linenum-bg: #ffcecb;
13+
--color-diff-removed-row-bg: #ffeef0;
14+
--color-diff-removed-word-bg: #fdb8c0;
15+
}
Lines changed: 13 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)