UNPKG

1.03 kBJavaScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, 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 TablePropertyCommand from './tablepropertycommand';
6/**
7 * The table background color command.
8 *
9 * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
10 * the `'tableBackgroundColor'` editor command.
11 *
12 * To change the background color of the selected table, execute the command:
13 *
14 * ```ts
15 * editor.execute( 'tableBackgroundColor', {
16 * value: '#f00'
17 * } );
18 * ```
19 */
20export default class TableBackgroundColorCommand extends TablePropertyCommand {
21 /**
22 * Creates a new `TableBackgroundColorCommand` 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, 'tableBackgroundColor', defaultValue);
29 }
30}