MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

Color

MMO.editor.tools · 1 symbole · générée le 27 Oct 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
Espace de noms
MMO.editor.tools
Étend
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'];

Méthodes5

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
retourne?stringthe colour of the selection, as it is written in the style

update(editor, node)

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