DefaultColorStyle

See source code

Default color style property used by tldraw shapes for their primary color. This style prop allows shapes to use any of the default color names and automatically saves the last used value for new shapes.

DefaultColorStyle: import('./StyleProp').EnumStyleProp<
  | 'black'
  | 'blue'
  | 'green'
  | 'grey'
  | 'light-blue'
  | 'light-green'
  | 'light-red'
  | 'light-violet'
  | 'orange'
  | 'red'
  | 'violet'
  | 'white'
  | 'yellow'
>

Example

import { DefaultColorStyle } from '@tldraw/tlschema'

// Use in shape props definition
interface MyShapeProps {
  color: typeof DefaultColorStyle
  // other props...
}

// Set color on a shape
const shape = {
  // ... other properties
  props: {
    color: 'red' as const,
    // ... other props
  },
}
Prev
defaultColorNames
Next
DefaultColorThemePalette