MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / updateSystemTheme

Function updateSystemTheme

src/theme/preInstalled.js:247–284  ·  view source on GitHub ↗
(darkTheme)

Source from the content-addressed store, hash-verified

245 * @param {boolean} darkTheme Whether the user prefers a dark theme.
246 */
247export function updateSystemTheme(darkTheme) {
248 if (darkTheme) {
249 system.type = "dark";
250 system.primaryColor = "rgb(35, 39, 42)";
251 system.primaryTextColor = "rgb(245, 245, 245)";
252 system.darkenedPrimaryColor = "rgb(24, 27, 30)";
253 system.secondaryColor = "rgb(45, 49, 52)";
254 system.secondaryTextColor = "rgb(228, 228, 228)";
255 system.activeColor = "rgb(66, 133, 244)";
256 system.linkTextColor = "rgb(138, 180, 248)";
257 system.borderColor = "rgba(188, 188, 188, 0.15)";
258 system.popupIconColor = "rgb(245, 245, 245)";
259
260 system.popupBackgroundColor = "rgb(35, 39, 42)";
261 system.popupTextColor = "rgb(245, 245, 245)";
262 system.popupActiveColor = "rgb(66, 133, 244)";
263 } else {
264 system.type = "light";
265 system.primaryColor = "rgb(255, 255, 255)";
266 system.primaryTextColor = "rgb(15, 23, 42)";
267 system.secondaryColor = "rgb(248, 250, 252)";
268 system.secondaryTextColor = "rgb(51, 65, 85)";
269 system.activeColor = "rgb(59, 130, 246)";
270 system.linkTextColor = "rgb(37, 99, 235)";
271 system.borderColor = "rgb(226, 232, 240)";
272 system.popupIconColor = "rgb(15, 23, 42)";
273
274 system.popupBackgroundColor = "rgb(255, 255, 255)";
275 system.popupTextColor = "rgb(15, 23, 42)";
276 system.popupActiveColor = "rgb(59, 130, 246)";
277 }
278
279 system.preferredEditorTheme = getSystemEditorTheme(darkTheme);
280
281 if (appSettings?.value?.appTheme === "system") {
282 apply(system.id);
283 }
284}
285
286const glass = createBuiltInTheme("Glass");
287glass.darkenedPrimaryColor = "rgb(250, 250, 255)";

Callers 2

addFunction · 0.90
syncSystemThemeFunction · 0.90

Calls 2

applyFunction · 0.90
getSystemEditorThemeFunction · 0.85

Tested by

no test coverage detected