@@ -535,24 +535,17 @@ export async function loadTheme(themeDir) {
535535 throw new Error ( "Theme image cannot escape through a link or junction" ) ;
536536 }
537537 const art = raw . art && typeof raw . art === "object" && ! Array . isArray ( raw . art ) ? raw . art : { } ;
538- const palette = raw . palette && typeof raw . palette === "object" && ! Array . isArray ( raw . palette )
539- ? raw . palette : { } ;
540538 const rawColors = raw . colors && typeof raw . colors === "object" && ! Array . isArray ( raw . colors )
541539 ? raw . colors : null ;
542540 const colorKeys = [
543541 "background" , "panel" , "panelAlt" , "accent" , "accentAlt" , "secondary" ,
544542 "highlight" , "text" , "muted" , "line" ,
545543 ] ;
546- const paletteAccent = typeof palette . accent === "string" && palette . accent . trim ( )
547- ? palette . accent . trim ( ) : "" ;
548- if ( paletteAccent && ! / ^ (?: # [ \d a - f ] { 3 , 8 } | (?: r g b | h s l | o k l c h | o k l a b ) \( [ ^ ; { } ] { 1 , 96 } \) ) $ / i. test ( paletteAccent ) ) {
549- throw new Error ( "palette.accent is not a supported CSS color" ) ;
550- }
551544 const colors = {
552545 background : normalizeThemeColor ( rawColors ?. background , "#071116" ) ,
553546 panel : normalizeThemeColor ( rawColors ?. panel , "#0b1a20" ) ,
554547 panelAlt : normalizeThemeColor ( rawColors ?. panelAlt , "#10272c" ) ,
555- accent : normalizeThemeColor ( rawColors ?. accent , normalizeThemeColor ( paletteAccent , "#7cff46" ) ) ,
548+ accent : normalizeThemeColor ( rawColors ?. accent , "#7cff46" ) ,
556549 accentAlt : normalizeThemeColor ( rawColors ?. accentAlt , "#b8ff3d" ) ,
557550 secondary : normalizeThemeColor ( rawColors ?. secondary , "#36d7e8" ) ,
558551 highlight : normalizeThemeColor ( rawColors ?. highlight , "#642a8c" ) ,
@@ -577,14 +570,10 @@ export async function loadTheme(themeDir) {
577570 safeArea : normalizedChoice ( art . safeArea , "art.safeArea" , THEME_CHOICES . safeArea , "auto" ) ,
578571 taskMode : normalizedChoice ( art . taskMode , "art.taskMode" , THEME_CHOICES . taskMode , "auto" ) ,
579572 } ,
580- colorMode : rawColors ? "explicit" : ( paletteAccent ? "explicit" : "auto" ) ,
581- explicitColorKeys : rawColors
582- ? colorKeys . filter ( ( key ) => Object . hasOwn ( rawColors , key ) )
583- : ( paletteAccent ? [ "accent" ] : [ ] ) ,
573+ colorMode : rawColors ? "explicit" : "auto" ,
574+ explicitColorKeys : rawColors ? colorKeys . filter ( ( key ) => Object . hasOwn ( rawColors , key ) ) : [ ] ,
584575 colors,
585- palette : { } ,
586576 } ;
587- if ( paletteAccent ) theme . palette . accent = paletteAccent ;
588577 const [ themeStat , imageStat , safeCss ] = await Promise . all ( [
589578 fs . stat ( themePath ) ,
590579 fs . stat ( realImagePath ) ,
@@ -1740,6 +1729,10 @@ if (path.resolve(process.argv[1] || "") === path.resolve(scriptPath)) {
17401729 payloadBytes : Buffer . byteLength ( loaded . payload ) ,
17411730 themeId : loaded . theme . id ,
17421731 appearance : loaded . theme . appearance ,
1732+ colorMode : loaded . theme . colorMode ,
1733+ explicitColorKeys : loaded . theme . explicitColorKeys ,
1734+ hasColors : ! ! loaded . theme . colors && typeof loaded . theme . colors === "object" ,
1735+ hasPalette : Object . hasOwn ( loaded . theme , "palette" ) ,
17431736 art : loaded . theme . art ,
17441737 artMetadata : loaded . theme . artMetadata ?? null ,
17451738 safeCssStatus : loaded . safeCssStatus ,
0 commit comments