Preparing search index...

    Enum specifying color role for styling.

    export class ColorRoleExamplePanel extends PanelPlugin {
    connections: any[];
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.ColorRoleExample';
    d.name = 'ColorRole Example';
    d.defaultDockState = DockState.Detached;
    d.defaultSize = new Size(350, 300);
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    }
    createWidget(parent: Widget): Widget {
    const root = new Widget(parent);
    const layout = new BoxLayout();
    layout.setDirection(Direction.TopToBottom);
    layout.spacing = 6;
    root.layout = layout;

    const title = new Label(root);
    title.text = 'ColorRole Demo';
    layout.addWidget(title);

    // ColorRole controls the semantic foreground color of a widget.
    // Set foregroundRole to style labels with theme-aware colors.
    const linkLabel = new Label(root);
    linkLabel.text = 'This label uses ColorRole.Link';
    linkLabel.foregroundRole = ColorRole.Link;
    layout.addWidget(linkLabel);

    const highlightLabel = new Label(root);
    highlightLabel.text = 'This label uses ColorRole.Highlight';
    highlightLabel.foregroundRole = ColorRole.Highlight;
    layout.addWidget(highlightLabel);

    const textLabel = new Label(root);
    textLabel.text = 'This label uses ColorRole.Text (default)';
    textLabel.foregroundRole = ColorRole.Text;
    layout.addWidget(textLabel);

    const brightLabel = new Label(root);
    brightLabel.text = 'This label uses ColorRole.BrightText';
    brightLabel.foregroundRole = ColorRole.BrightText;
    layout.addWidget(brightLabel);

    const btnTextLabel = new Label(root);
    btnTextLabel.text = 'This label uses ColorRole.ButtonText';
    btnTextLabel.foregroundRole = ColorRole.ButtonText;
    layout.addWidget(btnTextLabel);

    return root;
    }
    deinit(): void {
    this.connections.forEach((c: any) => c?.disconnect());
    this.connections = [];
    }
    }
    Index

    Enumeration Members

    AlternateBase: number

    Alternate base color for contrast.

    Base: number

    Base color for input areas and backgrounds.

    BrightText: number

    Color for bright text elements.

    Button: number

    Color for button backgrounds.

    ButtonText: number

    Color for button text.

    Dark: number

    Dark color variant.

    Highlight: number

    Color for highlighted elements.

    HighlightedText: number

    Color for highlighted text.

    Light: number

    Light color variant.

    Link: number

    Color for hyperlink text.

    LinkVisited: number

    Color for visited hyperlinks.

    Mid: number

    Mid color variant.

    Midlight: number

    Midlight color variant.

    NoRole: number

    No color role assigned.

    PlaceholderText: number

    Color for placeholder text.

    Shadow: number

    Color for shadow effects.

    Text: number

    Color for text elements.

    ToolTipBase: number

    Color for tooltip backgrounds.

    ToolTipText: number

    Color for tooltip text.

    Window: number

    Color for window backgrounds.

    WindowText: number

    Color for window text elements.