Message API/docs/capabilities/styles/global

Global Styles

Set default appearance properties for all annotations and drawings.

Overview

Global styles define the default visual appearance for new annotations, shapes, and measurements. Once set, all newly created elements will inherit these properties.

This is particularly useful for maintaining brand consistency, differentiating between user roles with color coding, or setting project-wide visual standards.

Quick Start

Set global colors and line properties with a single message.

javascript
iframe.contentWindow.postMessage({
  type: 'setGlobalAppearance',
  payload: {
    strokeColor: '#FF0000',
    fillColor: '#FFCCCC',
    textColor: '#000000',
    lineWidth: 3,
    transparency: 50
  }
}, '*');
Quick Start

Available Properties

Each style property is optional. Only include the properties you want to override.

  • strokeColor: Hex color string (e.g., `"#FF0000"` for red)
  • fillColor: Hex color string for shape interiors
  • textColor: Hex color string for text elements
  • lineWidth: Number from 1 to 10
  • lineStyle: Number representing line pattern (0 = solid, 1 = dashed, 2 = dotted)
  • transparency: Number from 0 (opaque) to 100 (fully transparent)

Additional Resources

Continue with technical references for styling.