Package limn.components
Enum Class Theme.Token
- All Implemented Interfaces:
Serializable,Comparable<Theme.Token>,Constable
- Enclosing class:
Theme
Every colour a palette is made of, as values, so that code which has to
treat every tone alike (a serializer, an editor, a contrast report) enumerates them
instead of naming them all and getting all but one right.
The order is the one a palette is reasoned about in: the surfaces it is built on, then the accent, then the ink, then the states, then the semantic four. It is stable, and a serialized palette's key order follows it.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTheme.background: the canvas a window clears to.Theme.danger: error and destructive.Theme.disabledFill: the fill of a control that cannot be used.Theme.disabledText: its label.Theme.focusRing: the ring around the focused control.Theme.info: informational.Theme.onPrimary: the label on an accent fill.Theme.outline: borders and separators.Theme.primary: the accent, at rest.Theme.primaryHover: the accent under the pointer.Theme.primaryPressed: the accent while held.Theme.scrim: the veil under a modal, and the one tone with an alpha.Theme.success: success and valid.Theme.surface: a card, a field, a panel on the canvas.Theme.surfaceRaised: a popover, a menu, a dialog above a surface.Theme.text: body ink.Theme.textMuted: secondary ink; still body text, still 4.5:1.Theme.warning: warning and caution. -
Method Summary
Modifier and TypeMethodDescriptionstatic Theme.Tokenkey()The stable identifier, spelled exactly like theThemefield it names: what a serialized palette writes and what an editor keys its rows by.This tone, read offtheme.read(Theme.Builder builder) This tone, asbuildercurrently holds it, before anybuild().static Theme.TokenReturns the enum constant of this class with the specified name.static Theme.Token[]values()Returns an array containing the constants of this enum class, in the order they are declared.write(Theme.Builder builder, Color color) Sets this tone onbuilder, and returns that builder for chaining.
-
Enum Constant Details
-
BACKGROUND
Theme.background: the canvas a window clears to. -
SURFACE
Theme.surface: a card, a field, a panel on the canvas. -
SURFACE_RAISED
Theme.surfaceRaised: a popover, a menu, a dialog above a surface. -
PRIMARY
Theme.primary: the accent, at rest. -
PRIMARY_HOVER
Theme.primaryHover: the accent under the pointer. -
PRIMARY_PRESSED
Theme.primaryPressed: the accent while held. -
ON_PRIMARY
Theme.onPrimary: the label on an accent fill. -
TEXT
Theme.text: body ink. -
TEXT_MUTED
Theme.textMuted: secondary ink; still body text, still 4.5:1. -
OUTLINE
Theme.outline: borders and separators. -
FOCUS_RING
Theme.focusRing: the ring around the focused control. -
DISABLED_FILL
Theme.disabledFill: the fill of a control that cannot be used. -
DISABLED_TEXT
Theme.disabledText: its label. -
SCRIM
Theme.scrim: the veil under a modal, and the one tone with an alpha. -
DANGER
Theme.danger: error and destructive. -
SUCCESS
Theme.success: success and valid. -
WARNING
Theme.warning: warning and caution. -
INFO
Theme.info: informational.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
key
The stable identifier, spelled exactly like theThemefield it names: what a serialized palette writes and what an editor keys its rows by. UnlikeEnum.name(), it is API: renaming it would orphan every saved palette. -
read
This tone, read offtheme. -
read
This tone, asbuildercurrently holds it, before anybuild(). -
write
Sets this tone onbuilder, and returns that builder for chaining. -
byKey
- Returns:
- the token whose
key()iskey, ornullif none is
-