June 1, 2026

Color control now supports object defaultValue

The Color control now accepts an object with color and opacity fields for its defaultValue, making it easy to set semi-transparent defaults directly in your component registration.

  • Object form defaultValue — Pass { color: "#000000", opacity: 0.5 } instead of a plain color string to define a default with transparency
  • Resolved RGBA string — The control still passes a single RGBA string to your component, so no changes are needed in your component code
  • Backward compatible — Plain CSS color strings (e.g., "black", "#4f46e5") continue to work as before

Example

1import { Color, Style } from "@makeswift/runtime/controls";
2
3runtime.registerComponent(Overlay, {
4 type: "overlay",
5 label: "Overlay",
6 props: {
7 className: Style(),
8 overlayColor: Color({
9 label: "Overlay color",
10 defaultValue: { color: "#000000", opacity: 0.5 },
11 }),
12 },
13});

Available since v0.28.6. For full documentation, see the Color control reference.