Matlab Apply Theme logo

Matlab Apply Theme

OrganizationPopular
matlab
matlab-apply-theme

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.

Overview

Publishermatlab
Repositorymatlab-agentic-toolkit
Skill namematlab-apply-theme
Stars
1.2K
Forks
138
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by matlab on GitHub. Read the source before you install it.

Installation

Install the Matlab Apply Theme AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/matlab-app-building/matlab-apply-theme
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit.git /tmp/matlab-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/matlab-agentic-toolkit/skills-catalog/matlab-app-building/matlab-apply-theme .claude/skills/matlab-apply-theme
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Matlab Apply Theme in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Matlab Apply Theme on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Matlab Apply Theme is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

MATLAB Theming

Style MATLAB charts with color palettes and — for uifigure apps — apply the R2025a Theme API for brand colors, dark mode, and component styling.

When to Use This Skill

Use this skill when:

  • Setting colororder for chart series colors (any context)
  • Choosing or importing a color palette for plots
  • Organizing brand colors into a reusable struct
  • Applying a custom colormap for continuous data
  • Implementing dark mode with fliplightness() (uifigure)
  • Wiring ThemeChangedFcn to react to OS/user theme changes (uifigure)
  • Using uistyle for conditional formatting in tables/trees (uifigure)
  • Importing an external color scheme (Material Design, Adobe Color, Tailwind)

When NOT to Use This Skill

  • Choosing chart types or building charts from scratch (use matlab-build-chart)
  • Building a full app layout (use matlab-build-app — it invokes this skill for theming sub-steps)
  • Setting colors on individual plot elements as a one-off (just use the Color property directly)
  • Non-MATLAB styling (CSS, HTML themes for web apps)

Critical Rules

Universal (all contexts)

  • MUST centralize brand/palette colors in a struct — never scatter RGB values
  • ALWAYS use colororder() for categorical chart series colors
  • ALWAYS use colormap() for continuous scalar-mapped colors
  • NEVER confuse colororder (categorical series) with colormap (continuous gradient)

Additional rules for uifigure apps (R2025a Theme API)

  • MUST use R2025a Theme API — do NOT manually set figure background or standard component colors
  • MUST use fliplightness() to derive dark variants unless explicitly designing custom dark colors
  • NEVER set a component's color explicitly unless branding requires it — breaks theme adaptation
  • ALWAYS use the semantic token vocabulary defined below for cross-path consistency

Semantic Token Vocabulary

Both MATLAB and web implementations map to these common tokens. When importing an external color scheme, map its colors to these tokens once.

TokenPurposeMATLAB (struct field)Web (CSS variable)
primaryBrand/action color (buttons, links, active states)theme.primary--accent
onPrimaryText/icon on primary backgroundtheme.onPrimary--accent-text
secondarySecondary brand color (less prominent actions)theme.secondary--secondary
errorError/destructive statetheme.error--error
successSuccess/confirmation statetheme.success--success
warningWarning/caution statetheme.warning--warning
borderCustom borders and dividerstheme.border--border
plotColorsChart series colors (Nx3 RGB matrix)theme.plotColorsN/A (use chart library config)

MATLAB note: Surface/text colors (--bg-primary, --text-primary in CSS) are NOT in the MATLAB theme struct. The R2025a Theme API handles those automatically. Only define brand/custom colors.

Quick Start

Color palettes for any figure

matlab
colors = [0 0.447 0.741; 0.85 0.33 0.10; 0.93 0.69 0.13; ...
          0.49 0.18 0.56; 0.47 0.67 0.19; 0.30 0.75 0.93];
colororder(ax, colors);
% All series in this axes now cycle through these colors

Theme struct for uifigure apps (R2025a)

matlab
function theme = createTheme(mode)
    arguments
        mode string {mustBeMember(mode, ["light", "dark"])} = "light"
    end
    theme.primary = [0 0.447 0.741];    % MATLAB blue
    theme.onPrimary = [1 1 1];
    theme.error = [0.83 0.18 0.18];
    theme.success = [0.22 0.56 0.24];
    theme.border = [0.88 0.88 0.88];
    theme.plotColors = [0 0.447 0.741; 0.85 0.33 0.10; 0.93 0.69 0.13; ...
                        0.49 0.18 0.56; 0.47 0.67 0.19; 0.30 0.75 0.93; 0.64 0.08 0.18];
    if mode == "dark"
        theme.primary = fliplightness(theme.primary);
        theme.plotColors = fliplightness(theme.plotColors);
    end
end

Wiring to a figure:

matlab
fig.ThemeChangedFcn = @(src, ~) applyTheme(src, ax);

function applyTheme(fig, ax)
    theme = createTheme(fig.Theme.BaseColorStyle);
    colororder(ax, theme.plotColors);
end

Light/Dark Strategy

  1. Don't set figure background, standard component bg/text — Theme API handles it automatically
  2. Do set brand colors (primary buttons, accent labels, status indicators) via theme struct
  3. Use ThemeChangedFcn to swap brand colors when OS/user toggles dark mode
  4. Use fliplightness() to auto-derive dark brand colors from light definitions
  5. Leave ColorMode = "auto" on components wherever possible

What breaks automatic theming — setting any color explicitly switches ColorMode to "manual":

matlab
btn.BackgroundColor = [0.2 0.4 0.8];  % Now manual — won't adapt to theme
btn.BackgroundColorMode = "auto";       % Restore theme control

Color Types in MATLAB

TypeAPIWhen to use
Component colorsbtn.BackgroundColor, lbl.FontColorUI element branding
Series colorscolororder(colors) or colororder("palette")Multiple lines/bars/scatter in one axes
Continuous colorscolormap(map)Heatmaps, surfaces, contours, images
Cell/row stylinguistyle + addStyleConditional formatting in tables/trees
  • colororder = categorical (series A, B, C get distinct colors)
  • colormap = continuous (scalar values mapped to gradient)
  • Don't confuse them — they serve different purposes

Importing External Color Schemes

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: rgb = sscanf(hex(2:end), '%2x', 3)' / 255
  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

See references/external-schemes.md for complete Material Design, Adobe Color, and Tailwind import examples.

Implementation Checklist

Styling

  • Brand colors centralized in createTheme struct
  • fliplightness() used for dark variants
  • Branded components tagged for findall lookup
  • ThemeChangedFcn wired to re-apply brand colors
  • colororder set from theme.plotColors
  • No explicit colors on auto-themed components

Troubleshooting

ProblemCauseFix
Component doesn't change with dark modeColor set explicitlyRemove explicit color or set BackgroundColorMode = "auto"
fliplightness not foundMATLAB < R2025aUpgrade or define manual dark colors
Chart colors don't update on theme switchcolororder not re-appliedAdd colororder(ax, theme.plotColors) to theme handler
findall returns emptyTag not set or misspelledVerify Tag property matches exactly

References

TopicFileDescription
Theme APIreferences/theme-api.mdR2025a lock/detect/react, auto vs manual theming
Component colorsreferences/component-colors.mdColor properties table + uistyle for tables/trees
External schemesreferences/external-schemes.mdMaterial Design, Adobe Color, Tailwind import workflows

Copyright 2026 The MathWorks, Inc.


Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Matlab Apply Theme AI skill do?

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.

Why use Matlab Apply Theme on TypingMind?

Because you install it once and use it with any model. Matlab Apply Theme is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Matlab Apply Theme in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/matlab-app-building/matlab-apply-theme. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Matlab Apply Theme?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Matlab Apply Theme?

As many as you like. As long as a model supports skills, you can use Matlab Apply Theme with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Matlab Apply Theme AI skill free?

It is published on GitHub by matlab. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇