How to Change the Color of Text in an Adaptive Card
Green for fine, amber for late, red for wrong: color makes a status readable at a glance. An Adaptive Card doesn't take color codes. A TextBlock names a color's meaning, and the app showing the card picks the actual color.
Syntax
{
"type": "TextBlock",
"text": "<text>",
"color": "<color name>",
"isSubtle": <true or false>
}
| Part | What it does |
|---|---|
color | Controls the color of TextBlock elements. One of default, dark, light, accent, good, warning or attention |
isSubtle | If true, displays text slightly toned down to appear less prominent. |
The descriptions and the names are from Microsoft's TextBlock reference. The colors behind the names come from the app that shows the card, through its host config: What is HostConfig? lists good, warning, attention and the others among its font colors.
The Example
A service status card has three lines, one per service, colored by their state: Good for Website: running, Warning for Nightly backup: running late, and Attention for File server: disk almost full. A last line, Checked at 09:00, is subtle.
Prerequisites
- An agent that sends Adaptive Cards in Microsoft Teams.
Step 1: Write the Card
{
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{ "type": "TextBlock", "text": "Service status", "size": "Large", "weight": "Bolder" },
{ "type": "TextBlock", "text": "Website: running", "color": "Good", "wrap": true },
{ "type": "TextBlock", "text": "Nightly backup: running late", "color": "Warning", "wrap": true },
{ "type": "TextBlock", "text": "File server: disk almost full", "color": "Attention", "wrap": true },
{ "type": "TextBlock", "text": "Checked at 09:00", "isSubtle": true, "wrap": true }
]
}

This card writes the names with a capital letter, as Microsoft's Teams documentation lists them; the schema reference lists them in lowercase.
Step 2: See It in Teams
Send the card from your agent, as How to Send an Adaptive Card in the Microsoft 365 Agents SDK in C# shows:

In Teams' light theme, the browser reported these colors for the three lines:
color | Color in Teams' light theme |
|---|---|
Good | rgb(14, 112, 14), green |
Warning | rgb(131, 91, 0), amber |
Attention | rgb(197, 15, 31), red |
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Color as the only sign of a problem | People who can't tell the colors apart miss it | Say it in the words too, as disk almost full does |
| Expecting the same color in every app | Each app picks its own colors for the names | Pick the name by meaning, not by look |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| A color looks different elsewhere | The app's host config defines it | Expected: the name sets the meaning |
FAQ
Can I color only part of a line?
Not in a TextBlock, where color applies to its whole text. A RichTextBlock holds TextRuns, and each TextRun takes its own color.
Which color for an error message in a form?
attention, the one Teams shows in red. It's what a form error looks like in How to Show an Error in a Teams Dialog in the Microsoft 365 Agents SDK in C#.
Conclusion
To color text in an Adaptive Card, set a TextBlock's color to one of the seven names, such as good, warning or attention, and use isSubtle for lines that matter less. The app showing the card picks the actual colors: in Teams' light theme, green, amber and red.
Additional Resources
- TextBlock, on Microsoft Learn.
- What is HostConfig?, on Microsoft Learn.
