Question: What would you use to access the tertiary brand color in a theme's fields.json file?
- brandSettings.colors[2]
- brandSettings.TertiaryColor
- brandSettings.colors[3]
- brandSettings.tertiaryColor
Explanation
In fields.json, HubSpot lets brand colors be referenced through brand_settings tokens, including the brand_settings.colors array. HubSpot’s documentation shows array-based color access using zero-based indexing, where the first entry is colors[0] and additional colors continue from colors[1] onward. That means the third color in the sequence is accessed at index 2. This is why the correct token uses the array form rather than a camel-case tertiary property name. HubSpot Developers
Why the other options are incorrect
brandSettings.TertiaryColor is incorrect because HubSpot documents brand_settings with snake_case naming and does not define a TertiaryColor token. HubSpot Developers
brandSettings.colors[3] is incorrect because HubSpot’s array access is zero-indexed, so index 3 points to the fourth color, not the third. HubSpot Developers
brandSettings.tertiaryColor is incorrect because HubSpot does not document a tertiaryColor token for fields.json brand color inheritance. HubSpot Developers
Source for verification
The answer(s) to the question is highlighted in the BOLD text above. You can also find more questions and answers related to the exams on the "HubSpot CMS for Developers II" page.
