import { TextSplittableAction } from './splittable-action.abstract';
import { TextColorAnnotation } from '../annotations/text-color-annotation';
/**
 * Action to toggle the text color annotation visibility/state.
 */
export class TextColorAnnotationAction extends TextSplittableAction {
  constructor(textColor) {
    super();
    this.isFlushable = true;
    this.textColor = textColor;
  }
  /**
   * Converts the action into a text color annotation.
   *
   * @returns {Annotation} the annotation
   */
  toAnnotation() {
    return new TextColorAnnotation(this.textColor);
  }
}
