1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

Add a lightness setting

This commit is contained in:
Grzesiek11 2024-06-24 05:44:40 +02:00
parent e226c457b9
commit b99fe6c70a
No known key found for this signature in database
GPG key ID: 4A5445FB68CDB5C4

View file

@ -17,7 +17,17 @@
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { definePluginSettings } from "@api/Settings";
import definePlugin, { OptionType } from "@utils/types";
const settings = definePluginSettings({
lightness: {
description: "Lightness, in %. Change if the colors are too light or too dark.",
restartNeeded: true,
type: OptionType.NUMBER,
default: 70,
},
});
export default definePlugin({
name: "IrcColors",
@ -32,6 +42,7 @@ export default definePlugin({
},
},
],
settings,
// Calculate a CSS color string based on the user ID
calculateNameColorForContext(context: any) {
return this.calculateNameColorForUser(BigInt(context.message.author.id));
@ -58,6 +69,6 @@ export default definePlugin({
}
const idHash = hash(idBuffer);
return `hsl(${idHash % 360n}, 100%, 70%)`;
return `hsl(${idHash % 360n}, 100%, ${settings.store.lightness}%)`;
},
});