Index

Color

MMO.editor.tools · 1 symbol · generated 30 Sep 2026

class

Color

Color.js:14

The text colour, or its highlight, chosen among the theme's colours.

class MMO.editor.tools.Color extends MMO.editor.PopoverTool
Namespace
MMO.editor.tools
Extends
PopoverTool
A colour is written as its design token (`<span style="color: var(--mmo-color-bad)">`), never as a hex value: the text follows the theme -- a reskin, the dark mode -- like the rest of the page does. So the list is of token names, and a colour pasted from elsewhere is dropped (`MMO.editor.ALLOWED_STYLES`).
//another palette for every editor of the page MMO.editor.Tool.Shared('color').colors = ['brand', 'bad', 'ok'];

Methods5

constructor(name, options)

Color.js:21
constructor(name, options = {})
namestring
options = {}ObjectMMO.editor.Tool, plus: - property {string} color or background-color - colors {Array<string>} the --mmo-color-* tokens offered

renderPopover(editor)

Color.js:27
renderPopover(editor)
editor

apply(editor, token)

Color.js:47
apply(editor, token)
editorHTMLElement
token?stringa --mmo-color-* name, null to take the colour off

current(editor)

Color.js:103
current(editor)
editorHTMLElement
returns?stringthe colour of the selection, as it is written in the style

update(editor, node)

Color.js:112
update(editor, node)
editor
node