From 4b087cb98ba18405ff62544bf971a5aa5433cc1b Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Wed, 2 Apr 2025 11:10:14 -0500 Subject: [PATCH] setting to disable role colors --- src/webpage/localuser.ts | 12 ++++++++++++ src/webpage/member.ts | 3 +++ translations/en.json | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index e171965..0ea789e 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -1630,6 +1630,18 @@ class Localuser { }; genSecurity(); } + { + const accessibility = settings.addButton(I18n.accessibility.name()); + accessibility.addCheckboxInput( + I18n.accessibility.roleColors(), + (t) => { + this.perminfo.user.disableColors = !t; + }, + { + initState: !this.perminfo.user.disableColors, + }, + ); + } { const connections = settings.addButton(I18n.getTranslation("localuser.connections")); const connectionContainer = document.createElement("div"); diff --git a/src/webpage/member.ts b/src/webpage/member.ts index cd0b2f6..8ac17e4 100644 --- a/src/webpage/member.ts +++ b/src/webpage/member.ts @@ -442,6 +442,9 @@ class Member extends SnowFlake { return false; } getColor() { + if (!this.localuser.perminfo.user.disableColors) { + return ""; + } for (const thing of this.roles) { const color = thing.getColor(); if (color) { diff --git a/translations/en.json b/translations/en.json index 67f8265..b7fdfe1 100644 --- a/translations/en.json +++ b/translations/en.json @@ -145,6 +145,10 @@ "noMessages": "No messages appear to be here, be the first to say something!", "blankMessage": "Blank Message", "spoiler": "Spoiler", + "accessibility": { + "name": "Accessibility", + "roleColors": "Disable role colors" + }, "channel": { "name": "Channel", "copyId": "Copy channel id",