Background color plugin
$ yarn add @aomao/plugin-backcolor
Add to engine
import Engine, {EngineInterface} from'@aomao/engine';import Backcolor from'@aomao/plugin-backcolor';new Engine(...,{ plugins:[Backcolor] })
No shortcut keys by default
//Shortcut keys, key combination keys, args, execution parameters, [color,defaultColor?], color is required, defaultColor is optionalhotkey?:{key:string,args:Array<string>};//default none//Use configurationnew Engine(...,{config:{"backcolor":{//Modify shortcut keyshotkey:{key:"mod+b",args:["#000000","#ffffff"]}}}})
//color: the changed background color, defaultColor: the default background color to keep, modify the background color when the defaultColor is not passed in or the color is different from the defaultColor valueengine.command.execute('backcolor', color, defaultColor);//Use command to query the current state, return Array<string> | undefined, the background color value set where the cursor is currently locatedengine.command.queryState('backcolor');