UNPKG

1.08 kBJavaScriptView Raw
1/**
2 * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5import TableCellPropertyCommand from './tablecellpropertycommand.js';
6/**
7 * The table cell background color command.
8 *
9 * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as
10 * the `'tableCellBackgroundColor'` editor command.
11 *
12 * To change the background color of selected cells, execute the command:
13 *
14 * ```ts
15 * editor.execute( 'tableCellBackgroundColor', {
16 * value: '#f00'
17 * } );
18 * ```
19 */
20export default class TableCellBackgroundColorCommand extends TableCellPropertyCommand {
21 /**
22 * Creates a new `TableCellBackgroundColorCommand` instance.
23 *
24 * @param editor An editor in which this command will be used.
25 * @param defaultValue The default value of the attribute.
26 */
27 constructor(editor, defaultValue) {
28 super(editor, 'tableCellBackgroundColor', defaultValue);
29 }
30}