Files
pico-launcher/arm9/source/themes/Theme.cpp
2025-11-25 17:41:31 +01:00

18 lines
613 B
C++

#include "common.h"
#include "core/mini-printf.h"
#include "material/MaterialColorSchemeFactory.h"
#include "Theme.h"
Theme::Theme(const TCHAR* folderName, const Rgb<8, 8, 8>& primaryColor, bool darkMode)
: _folderName(folderName)
{
MaterialColorSchemeFactory::FromPrimaryColor(primaryColor, darkMode, _materialColorScheme);
}
bool Theme::OpenThemeFile(File& file, const TCHAR* subPath) const
{
TCHAR pathBuffer[128];
mini_snprintf(pathBuffer, sizeof(pathBuffer), "/_pico/themes/%s/%s", _folderName.GetString(), subPath);
return file.Open(pathBuffer, FA_OPEN_EXISTING | FA_READ) == FR_OK;
}