diff --git a/THEMING.md b/THEMING.md index a7853870..2310df47 100644 --- a/THEMING.md +++ b/THEMING.md @@ -2,18 +2,33 @@ This document should document what are themes, how they're structured, and how to make them. +Example themes can be found in the [themes](/themes/) folder of this project. + ## Theme Structure A theme is a folder placed in `sd:/retro-go/themes` containing the following files: +```` +/retro-go/themes +└── example + ├── background_*.png + ├── banner_*.png + ├── logo_*.png + ├── preview.png + └── theme.json +```` + | Name | Format | Description | Required | |--|--|--|--| | theme.json | JSON | Contains the theme metadata (description, author, colors, etc) | Yes | | preview.png | PNG 160x120 | Theme preview to be displayed in the theme selector | No | -| background_X.png | PNG 320x240 | Launcher backgrounds where X is the name of the launcher tab (see launcher/main/images) | No | -| banner_X.png | PNG 272x24 | Launcher banners where X is the name of the launcher tab (see launcher/main/images) | No | -| logo_X.png | PNG 46x50 | Launcher logos where X is the name of the launcher tab (see launcher/main/images) | No | +| background_X.png | PNG 320x240 | Launcher backgrounds where X is the name of the launcher tab | No | +| banner_X.png | PNG 272x24 | Launcher banners where X is the name of the launcher tab | No | +| logo_X.png | PNG 46x50 | Launcher logos where X is the name of the launcher tab | No | + +It is highly recommended to keep the image files sizes as small as possible to ensure good loading speed. This can be achieved by using the lowest bit depth possible when saving your PNG file. Tools like [pngquant](https://pngquant.org/) can also help! + ### theme.json @@ -33,6 +48,7 @@ Colors are RGB565 and can be represented as integers or hex strings. The special "border": "0x6B4D", "header": "0xFFFF", "scrollbar": "0xFFFF", + "shadow": "none", "item_standard": "0xFFFF", "item_disabled": "0x8410", "item_message": "0xBDF7" diff --git a/components/retro-go/rg_gui.c b/components/retro-go/rg_gui.c index 2c8ade16..be602038 100644 --- a/components/retro-go/rg_gui.c +++ b/components/retro-go/rg_gui.c @@ -28,6 +28,7 @@ static struct rg_color_t item_disabled; rg_color_t item_message; rg_color_t scrollbar; + rg_color_t shadow; } style; char theme_name[32]; cJSON *theme_obj; @@ -173,6 +174,7 @@ bool rg_gui_set_theme(const char *theme_name) gui.style.item_disabled = rg_gui_get_theme_color("dialog", "item_disabled", C_GRAY); gui.style.item_message = rg_gui_get_theme_color("dialog", "item_message", C_SILVER); gui.style.scrollbar = rg_gui_get_theme_color("dialog", "scrollbar", C_WHITE); + gui.style.shadow = rg_gui_get_theme_color("dialog", "shadow", C_NONE); return true; } diff --git a/themes/default/README.md b/themes/default/README.md new file mode 100644 index 00000000..cef3559b --- /dev/null +++ b/themes/default/README.md @@ -0,0 +1,9 @@ +At this time the default theme is hardcoded in retro-go. You can find some of its values in those places: + +- `components/retro-go/rg_gui.c` +- `launcher/main/gui.c` +- `launcher/main/images/` + +At some point all of that stuff will be moved here... + +But in the mean time, if you're looking to build your own theme, you can use the `example` theme as a template instead. diff --git a/assets/es-theme-gbz35-master.zip b/themes/default/es-theme-gbz35-master.zip similarity index 100% rename from assets/es-theme-gbz35-master.zip rename to themes/default/es-theme-gbz35-master.zip diff --git a/themes/example/background_2600.png b/themes/example/background_2600.png new file mode 100644 index 00000000..0f2e21c3 Binary files /dev/null and b/themes/example/background_2600.png differ diff --git a/themes/example/background_col.png b/themes/example/background_col.png new file mode 100644 index 00000000..f260681f Binary files /dev/null and b/themes/example/background_col.png differ diff --git a/themes/example/background_collections.png b/themes/example/background_collections.png new file mode 100644 index 00000000..9dd88e90 Binary files /dev/null and b/themes/example/background_collections.png differ diff --git a/themes/example/background_doom.png b/themes/example/background_doom.png new file mode 100644 index 00000000..f5450919 Binary files /dev/null and b/themes/example/background_doom.png differ diff --git a/themes/example/background_favorite.png b/themes/example/background_favorite.png new file mode 100644 index 00000000..52e0e12d Binary files /dev/null and b/themes/example/background_favorite.png differ diff --git a/themes/example/background_gb.png b/themes/example/background_gb.png new file mode 100644 index 00000000..24ea323c Binary files /dev/null and b/themes/example/background_gb.png differ diff --git a/themes/example/background_gbc.png b/themes/example/background_gbc.png new file mode 100644 index 00000000..89825891 Binary files /dev/null and b/themes/example/background_gbc.png differ diff --git a/themes/example/background_gg.png b/themes/example/background_gg.png new file mode 100644 index 00000000..25fe0331 Binary files /dev/null and b/themes/example/background_gg.png differ diff --git a/themes/example/background_gw.png b/themes/example/background_gw.png new file mode 100644 index 00000000..10717b51 Binary files /dev/null and b/themes/example/background_gw.png differ diff --git a/themes/example/background_lnx.png b/themes/example/background_lnx.png new file mode 100644 index 00000000..3718c758 Binary files /dev/null and b/themes/example/background_lnx.png differ diff --git a/themes/example/background_md.png b/themes/example/background_md.png new file mode 100644 index 00000000..4b6f7c47 Binary files /dev/null and b/themes/example/background_md.png differ diff --git a/themes/example/background_msx.png b/themes/example/background_msx.png new file mode 100644 index 00000000..c611f034 Binary files /dev/null and b/themes/example/background_msx.png differ diff --git a/themes/example/background_nes.png b/themes/example/background_nes.png new file mode 100644 index 00000000..a93d8109 Binary files /dev/null and b/themes/example/background_nes.png differ diff --git a/themes/example/background_pce.png b/themes/example/background_pce.png new file mode 100644 index 00000000..ff58d1da Binary files /dev/null and b/themes/example/background_pce.png differ diff --git a/themes/example/background_recent.png b/themes/example/background_recent.png new file mode 100644 index 00000000..202faeac Binary files /dev/null and b/themes/example/background_recent.png differ diff --git a/themes/example/background_sms.png b/themes/example/background_sms.png new file mode 100644 index 00000000..adcafed7 Binary files /dev/null and b/themes/example/background_sms.png differ diff --git a/themes/example/background_snes.png b/themes/example/background_snes.png new file mode 100644 index 00000000..67239dc2 Binary files /dev/null and b/themes/example/background_snes.png differ diff --git a/themes/example/banner_gb.png b/themes/example/banner_gb.png new file mode 100644 index 00000000..152de772 Binary files /dev/null and b/themes/example/banner_gb.png differ diff --git a/themes/example/banner_gbc.png b/themes/example/banner_gbc.png new file mode 100644 index 00000000..521679eb Binary files /dev/null and b/themes/example/banner_gbc.png differ diff --git a/themes/example/banner_gg.png b/themes/example/banner_gg.png new file mode 100644 index 00000000..b40055e2 Binary files /dev/null and b/themes/example/banner_gg.png differ diff --git a/themes/example/banner_gw.png b/themes/example/banner_gw.png new file mode 100644 index 00000000..3406d2cf Binary files /dev/null and b/themes/example/banner_gw.png differ diff --git a/themes/example/banner_lnx.png b/themes/example/banner_lnx.png new file mode 100644 index 00000000..b702d9e0 Binary files /dev/null and b/themes/example/banner_lnx.png differ diff --git a/themes/example/banner_md.png b/themes/example/banner_md.png new file mode 100644 index 00000000..f81ae96a Binary files /dev/null and b/themes/example/banner_md.png differ diff --git a/themes/example/banner_nes.png b/themes/example/banner_nes.png new file mode 100644 index 00000000..70cbd5e0 Binary files /dev/null and b/themes/example/banner_nes.png differ diff --git a/themes/example/banner_ngp.png b/themes/example/banner_ngp.png new file mode 100644 index 00000000..f2b3ada1 Binary files /dev/null and b/themes/example/banner_ngp.png differ diff --git a/themes/example/banner_pce.png b/themes/example/banner_pce.png new file mode 100644 index 00000000..5d469fe4 Binary files /dev/null and b/themes/example/banner_pce.png differ diff --git a/themes/example/banner_recent.png b/themes/example/banner_recent.png new file mode 100644 index 00000000..6bf1c803 Binary files /dev/null and b/themes/example/banner_recent.png differ diff --git a/themes/example/banner_sms.png b/themes/example/banner_sms.png new file mode 100644 index 00000000..94782c52 Binary files /dev/null and b/themes/example/banner_sms.png differ diff --git a/themes/example/banner_snes.png b/themes/example/banner_snes.png new file mode 100644 index 00000000..defd7e8c Binary files /dev/null and b/themes/example/banner_snes.png differ diff --git a/themes/example/logo_col.png b/themes/example/logo_col.png new file mode 100644 index 00000000..20ae5d22 Binary files /dev/null and b/themes/example/logo_col.png differ diff --git a/themes/example/logo_doom.png b/themes/example/logo_doom.png new file mode 100644 index 00000000..017745e9 Binary files /dev/null and b/themes/example/logo_doom.png differ diff --git a/themes/example/logo_favorite.png b/themes/example/logo_favorite.png new file mode 100644 index 00000000..cafb15b5 Binary files /dev/null and b/themes/example/logo_favorite.png differ diff --git a/themes/example/logo_gb.png b/themes/example/logo_gb.png new file mode 100644 index 00000000..f9cee164 Binary files /dev/null and b/themes/example/logo_gb.png differ diff --git a/themes/example/logo_gbc.png b/themes/example/logo_gbc.png new file mode 100644 index 00000000..e58f3231 Binary files /dev/null and b/themes/example/logo_gbc.png differ diff --git a/themes/example/logo_gg.png b/themes/example/logo_gg.png new file mode 100644 index 00000000..8eeed40d Binary files /dev/null and b/themes/example/logo_gg.png differ diff --git a/themes/example/logo_gw.png b/themes/example/logo_gw.png new file mode 100644 index 00000000..1ae982c1 Binary files /dev/null and b/themes/example/logo_gw.png differ diff --git a/themes/example/logo_lnx.png b/themes/example/logo_lnx.png new file mode 100644 index 00000000..f0cc83e7 Binary files /dev/null and b/themes/example/logo_lnx.png differ diff --git a/themes/example/logo_md.png b/themes/example/logo_md.png new file mode 100644 index 00000000..dd0b509b Binary files /dev/null and b/themes/example/logo_md.png differ diff --git a/themes/example/logo_msx.png b/themes/example/logo_msx.png new file mode 100644 index 00000000..ddd127c1 Binary files /dev/null and b/themes/example/logo_msx.png differ diff --git a/themes/example/logo_nes.png b/themes/example/logo_nes.png new file mode 100644 index 00000000..6100b178 Binary files /dev/null and b/themes/example/logo_nes.png differ diff --git a/themes/example/logo_ngp.png b/themes/example/logo_ngp.png new file mode 100644 index 00000000..49cafdca Binary files /dev/null and b/themes/example/logo_ngp.png differ diff --git a/themes/example/logo_pce.png b/themes/example/logo_pce.png new file mode 100644 index 00000000..c6f8b872 Binary files /dev/null and b/themes/example/logo_pce.png differ diff --git a/themes/example/logo_recent.png b/themes/example/logo_recent.png new file mode 100644 index 00000000..3a96fd1f Binary files /dev/null and b/themes/example/logo_recent.png differ diff --git a/themes/example/logo_sms.png b/themes/example/logo_sms.png new file mode 100644 index 00000000..d3d34b47 Binary files /dev/null and b/themes/example/logo_sms.png differ diff --git a/themes/example/logo_snes.png b/themes/example/logo_snes.png new file mode 100644 index 00000000..c80297b4 Binary files /dev/null and b/themes/example/logo_snes.png differ diff --git a/themes/example/theme.json b/themes/example/theme.json new file mode 100644 index 00000000..de1302c3 --- /dev/null +++ b/themes/example/theme.json @@ -0,0 +1,53 @@ +{ + "description": "An example theme to show how themes are made", + "website": "https://github.com/ducalex/retro-go/", + "author": "ducalex", + "dialog": { + "__comment": "This section contains global dialog colors", + "background": "0xFFEF", + "foreground": "0x0000", + "border": "0x94B2", + "header": "0x0000", + "scrollbar": "0x0000", + "shadow": "none", + "item_standard": "0x0000", + "item_disabled": "0xF8B2", + "item_message": "0x4208" + }, + "launcher_1": { + "__comment": "This section contains launcher colors variant 1", + "background": "0xFFFF", + "foreground": "0x0021", + "list_standard_bg": "transparent", + "list_standard_fg": "0xF8B2", + "list_selected_bg": "transparent", + "list_selected_fg": "0xF800" + }, + "launcher_2": { + "__comment": "This section contains launcher colors variant 2", + "background": "0xFFFF", + "foreground": "0x0021", + "list_standard_bg": "transparent", + "list_standard_fg": "0x2444", + "list_selected_bg": "transparent", + "list_selected_fg": "0x07E0" + }, + "launcher_3": { + "__comment": "This section contains launcher colors variant 3", + "background": "0xFFFF", + "foreground": "0x0021", + "list_standard_bg": "transparent", + "list_standard_fg": "0xF8B2", + "list_selected_bg": "0xF800", + "list_selected_fg": "0xFFFF" + }, + "launcher_4": { + "__comment": "This section contains launcher colors variant 4", + "background": "0xFFFF", + "foreground": "0x0021", + "list_standard_bg": "transparent", + "list_standard_fg": "0x52AA", + "list_selected_bg": "0xF800", + "list_selected_fg": "0xFFFF" + } +} \ No newline at end of file