Skip to content

Theme & resource packs

Every colour and spacing of Galdur UI comes from one file, theme.json. It is reloaded with resources, and a resource pack can change all or part of it.

⏱ 5 minGaldur UI 0.1.0Client

theme.json

assets/galdurui/theme.json is the single source of the style guide: colours, and spacings in the spacing section.

assets/galdurui/theme.json
{  "background": "#2A2420",  "surface": "#352E29",  "text": "#F8F3E8",  "text_muted": "#C9BEAD",  "accent": "#B8341F",  "accent_hover": "#D9573D",  "accent_pressed": "#952A18",  "ember": "#D98A1F",  "spacing": {    "panel_padding": 16,    "gap": 8,    "button_padding_x": 6,    "button_min_width": 40,    "button_height": 20,    "list_row_height": 12,    "scrollbar_width": 4,    "field_height": 16,    "tab_height": 16,    "tab_padding_x": 8,    "progress_height": 12  }}

Colours

KeyUsed for
backgroundMain screen background (charcoal).
surfaceElements placed on the background: lists, fields.
textMain text colour (cream).
text_mutedSecondary, less contrasted text.
accentAccent colour at rest (redstone).
accent_hoverAccent under the mouse or keyboard focus.
accent_pressedAccent while pressed.
emberWarm secondary colour, for highlights.

Write colours as "#RRGGBB" (opaque) or "#AARRGGBB". A JSON integer is accepted; if it fits in 24 bits (≤ 0xFFFFFF, so no alpha byte), it is read as opaque RRGGBB with a warning in the log, rather than giving an invisible colour.

Spacings are in GUI pixels. They apply the next time a screen is built.

Change it with a resource pack

Ship a theme.json at the same path in a resource pack: assets/galdurui/theme.json. It can be partial: the file from the jar provides the defaults for every missing key.

blue_theme/assets/galdurui/theme.json
{  "background": "#18222E",  "surface": "#22303F",  "accent": "#2F6FB8",  "accent_hover": "#4F8FD9",  "accent_pressed": "#24568F",  "ember": "#3FC1D9",  "spacing": {    "button_height": 24,    "gap": 12  }}

This is the blue theme pack shipped by the test mod (Options → Resource Packs). text and most spacings are missing, so they fall back to the defaults. An invalid colour (not #RRGGBB or #AARRGGBB) logs a warning and keeps the default too.

Reload while a screen is open

Minecraft ignores F3+T while a screen is open. In /galdurui test, use the "Reload theme" button.

Read the theme in code

GaldurTheme gives colours as packed ARGB (0xAARRGGBB), the format Minecraft's rendering methods expect, and spacings in pixels.

Example.java
int accent = GaldurTheme.accent();int gap = GaldurTheme.gap();int custom = GaldurTheme.colorOrDefault("mymod_energy", 0xFF3FC1D9);
Never cache theme values

Read colours and spacings every frame or every init(), never in a static final field: a resource pack can change them at any time.

Your own keys

A mod can read its own colour keys with colorOrDefault(key, fallback) and test them with has(key). A resource pack that wants to style your mod adds the key to its theme.json; without it, your fallback is used.

A themed panel around vanilla layouts

GaldurPanelLayout wraps any vanilla layout in a themed background panel, with the theme padding. Use it to give a hand-made Screen the same look as Galdur UI windows. The panel is drawn with a grayscale sprite tinted by the theme: see Sprites.

© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyNot an official Minecraft product. Not approved by or associated with Mojang or Microsoft.