ChangeSegmentColourCommand

Change segment colour command.

Constructor

new ChangeSegmentColourCommand(mask, segment, newColour, silentopt)

Parameters:
NameTypeAttributesDescription
maskImage

The mask image.

segmentMaskSegment

The segment to modify.

newColourRGB | number

The new segment colour.

silentboolean<optional>

Whether to send a creation event or not.

Classes

ChangeSegmentColourCommand

Methods

execute()

Execute the command.

getName() → {string}

Get the command name.

Returns:

The command name.

Type: 
string

isValid() → {boolean}

Check if a command is valid and can be executed.

Returns:

True if the command is valid.

Type: 
boolean

onExecute(_event)

Handle an execute event.

Parameters:
NameTypeDescription
_eventobject

The execute event with type and id.

onUndo(_event)

Handle an undo event.

Parameters:
NameTypeDescription
_eventobject

The undo event with type and id.

undo()

Undo the command.

Events

changemasksegmentcolour

Segment delete event.

Type:
  • object
Properties
NameTypeDescription
segmentnumbernumber

The segment number.

changemasksegmentcolour

Segment redraw event.

Type:
  • object
Properties
NameTypeDescription
segmentnumbernumber

The segment number.