Blocks - HB-Hridoy/th-m-l-t GitHub Wiki
Methods
Purpose: Initializes and loads data for color themes, fonts, and translations.
Parameter | Type |
---|---|
colorThemes | text |
fonts | text |
translations | text |
🔧 Need help configuring your Translations, Fonts, or Colors?
📖 Follow the official Data Configuration Guide → to set up your JSON schemas correctly.
Purpose: Applies formatting to a layout using the active theme and language.
Parameter | Type |
---|---|
layout | component |
Purpose: Applies formatting to a layout using a specific theme and language.
Parameter | Type |
---|---|
layout | component |
themeMode | text |
languageCode | text |
Purpose: Retrieves a list of values for a given data category.
Parameter | Type |
---|---|
data | All (helper enums) |
Return: list
Why: Returns the complete list of items for enums like PrimitiveKeys
, SemanticKeys
, ThemeModes
, FontTags
, FontShortTags
, TranslationKeys
, SupportedLanguages
.
Purpose: Returns a translation for a given key using the active language.
Parameter | Type |
---|---|
translationKey | text |
Return: text
Why: Returns the corresponding translation string, or Not Found
if missing.
Purpose: Returns a font name for a given key using the tag.

Parameter | Type |
---|---|
tag | text |
Return: text
Why: Returns the corresponding font name, or Font not found
if missing.
Purpose: Returns a translation for a key in a specific language.
Parameter | Type |
---|---|
translationKey | text |
languageCode | text |
Return: text
Why:
- Returns the translation string if found.
- Returns
Not Found
if the key is missing. - Returns
'languageCode' is not supported
if the languageCode is invalid.
Purpose: Retrieves a primitive color as an integer value.
Parameter | Type |
---|---|
key | text |
Return: number
Why:
- Returns the integer color value if key exists.
- Returns
-1
if not found (error condition).
Purpose: Retrieves the source reference of a semantic color for the active theme.
Parameter | Type |
---|---|
key | text |
Return: text
Why:
- Returns the primitive color key.
- Returns a detailed error if the theme or key doesn't exist.
Purpose: Retrieves a semantic color value (int) for the active theme mode.
Parameter | Type |
---|---|
key | text |
Return: number
Why:
- Returns resolved color as int if found.
- Returns
-1
if theme mode or color key is invalid.
Purpose: Retrieves a semantic color value for a specific theme mode.
Parameter | Type |
---|---|
key | text |
themeMode | text |
Return: number
Why:
- Returns resolved color as int if key exists in the given mode.
- Returns
-1
for missing theme/key.
Properties
Sets the regular font.
Input | Type |
---|---|
font | text |
Sets the bold font.
Input | Type |
---|---|
font | text |
Sets the material icon font.
Input | Type |
---|---|
font | text |
Sets the primary color.
Input | Type |
---|---|
color | number |
Sets the secondary color.
Input | Type |
---|---|
color | number |
Sets the accent color.
Input | Type |
---|---|
color | number |
Sets the active translation language.
Input | Type |
---|---|
code | text |
Sets the active theme mode (e.g.,
light
,dark
).
Input | Type |
---|---|
mode | text |
Gets the regular font.
Return | Type |
---|---|
font | text |
Gets the bold font.
Return | Type |
---|---|
font | text |
Gets the material font.
Return | Type |
---|---|
font | text |
Gets the primary color.
Return | Type |
---|---|
color | number |
Gets the secondary color.
Return | Type |
---|---|
color | number |
Gets the accent color.
Return | Type |
---|---|
color | number |
Gets the current language code.
Return | Type |
---|---|
code | text |
Gets the current theme mode.
Return | Type |
---|---|
mode | text |