Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/matlab-app-building/matlab-apply-theme

matlab-apply-theme

Verified

Style MATLAB charts and figures. colororder palettes for chart series colors, colormap selection, brand color organization, and the R2025a Theme API for uifigure apps (dark mode with fliplightness, ThemeChangedFcn, uistyle, component colors). Use when customizing chart colors, applying a color palette, organizing brand colors, implementing dark mode, or importing an external color scheme. Triggers: theme, dark mode, brand colors, colororder, colormap, palette, fliplightness, color scheme, styling, chart colors.

FileKindSize
SKILL.mdskill md8.1 KB
manifest.yamlconfig479 B
references/component-colors.mdexecutablescript2.0 KB
references/external-schemes.mdexecutablescript2.1 KB
references/theme-api.mdexecutablescript1.5 KB

references/external-schemes.md

View on GitHub
# Importing External Color Schemes

See the semantic token vocabulary in `matlab-apply-theme` for the full cross-path guide.

## Material Design Example

```matlab
function theme = createTheme(mode)
    % Material Design Indigo + Pink
    theme.primary    = [0.22 0.29 0.67];  % Indigo 600
    theme.onPrimary  = [1 1 1];
    theme.secondary  = [0.93 0.25 0.48];  % Pink 400
    theme.error      = [0.83 0.18 0.18];  % Red 700
    theme.success    = [0.22 0.56 0.24];  % Green 700
    theme.warning    = [0.96 0.49 0.00];  % Orange 700
    theme.border     = [0.88 0.88 0.88];  % Grey 300
    theme.plotColors = [
        0.22 0.29 0.67   % Indigo 600
        0.93 0.25 0.48   % Pink 400
        0.00 0.59 0.53   % Teal 500
        1.00 0.60 0.00   % Amber 800
        0.38 0.49 0.55   % Blue Grey 500
    ];
    if mode == "dark"
        theme.primary   = fliplightness(theme.primary);
        theme.onPrimary = fliplightness(theme.onPrimary);
        theme.secondary = fliplightness(theme.secondary);
        theme.error     = fliplightness(theme.error);
        theme.success   = fliplightness(theme.success);
        theme.warning   = fliplightness(theme.warning);
        theme.border    = fliplightness(theme.border);
        theme.plotColors = fliplightness(theme.plotColors);
    end
end
```

## Converting Hex to RGB for MATLAB

```matlab
% Manual: divide each pair by 255
% #3949AB -> [0x39/255, 0x49/255, 0xAB/255] = [0.22, 0.29, 0.67]

% Or use sscanf:
hex = '#3949AB';
rgb = sscanf(hex(2:end), '%2x', 3)' / 255;
```

## Import Workflow

1. **Pick a scheme** from Material Design, Adobe Color, Tailwind, etc.
2. **Extract 5-7 key colors**: primary, secondary, error, success, warning, border + 5-7 chart series colors
3. **Convert hex to [R G B]** normalized 0-1 using the formula above
4. **Map to theme struct fields**: `theme.primary`, `theme.secondary`, etc.
5. **Test both modes**: verify `fliplightness()` produces acceptable dark variants; override manually if not
6. **Apply via `applyBrandColors`**: the function reads the struct and sets tagged components

----

Copyright 2026 The MathWorks, Inc.

----
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall