color paints the on track. success, warning and error use the status colors. antd's presets (blue, green, gold and the rest) and palettes from your theme (the default theme adds amber, emerald, teal, sky, indigo, violet, fuchsia, rose and grays like slate and zinc) use that hue, with a lighter shade on hover and for the focus ring. A gray palette, a CSS color or an unknown name falls back to primary, because a gray on track reads as off.
- Keep primary for most switches. A column of settings in five colors asks the reader to decode colors that mean nothing.
- Use a status color when the on state carries that meaning: error where on is the dangerous direction, success where on is the healthy one.
- Use another hue for identity: a switch that belongs to a product area or category already color-coded on the page.
- To change the color of every switch, set colorPrimary or components.Switch in your theme instead of passing color everywhere.
- Red on a switch means on is the dangerous state, not that the control is invalid. Pair it with a confirm step.
- Only the knob's position and the track color tell on from off. Add checkedChildren where the state has to be read at a glance.