Foreground plugin
$ yarn add @aomao/plugin-fontcolor
Add to engine
import Engine, {EngineInterface} from'@aomao/engine';import Fontcolor from'@aomao/plugin-fontcolor';new Engine(...,{ plugins:[Fontcolor] })
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:{"fontcolor":{//Modify shortcut keyshotkey:{key:"mod+b",args:["#000000","#ffffff"]}}}})
//color: the changed foreground color, defaultColor: the default foreground color to be maintained, the foreground color modification is performed when the defaultColor is not passed in or the color is different from the defaultColor valueengine.command.execute('fontcolor', color, defaultColor);//Use command to query the current state, return Array<string> | undefined, the foreground color value set where the cursor is currently locatedengine.command.queryState('fontcolor');