Description
Custom colors are loaded from settings as an array of hex strings. If the custom color array is mutated to contain fewer or more than 3 elements (e.g., via manual file modification), the visualizer can fail to render correctly or throw exceptions due to undefined array indices.
Steps to Reproduce
- Manually edit
themeProfiles.json and change the customColors array of a profile to contain only 1 color (e.g. ["#ff0000"]).
- Open Settings → Theme Profiles and load that profile.
- Observe the visualizer rendering or console logs.
Expected Behaviour
The colors array should be sanitized to ensure it contains exactly 3 valid hex strings, falling back to default colors if the structure is invalid.
Actual Behaviour
The array is loaded and passed directly to the renderer without length validation.
Description
Custom colors are loaded from settings as an array of hex strings. If the custom color array is mutated to contain fewer or more than 3 elements (e.g., via manual file modification), the visualizer can fail to render correctly or throw exceptions due to undefined array indices.
Steps to Reproduce
themeProfiles.jsonand change thecustomColorsarray of a profile to contain only 1 color (e.g.["#ff0000"]).Expected Behaviour
The colors array should be sanitized to ensure it contains exactly 3 valid hex strings, falling back to default colors if the structure is invalid.
Actual Behaviour
The array is loaded and passed directly to the renderer without length validation.