Package limn.components
Enum Class Tone
- All Implemented Interfaces:
Serializable,Comparable<Tone>,Constable
Which of the palette's colours a piece of text or a mark is drawn in, said by what it means rather
than by the colour: a line that reports a failure is
DANGER, whatever red the palette in
force calls danger.
A tone is resolved when it is drawn, not when it is set. A Color read off
Theme.current() while a page is built is the palette of that moment, and a change of
palette afterwards (the system turning dark, the user picking another) leaves it behind; a tone
is asked of the theme on every paint, so it follows. That is what Label.setTone(limn.components.Tone) gives a
line of text, and what a Field draws its line under the control with.
Each tone is one of the palette's tokens, so its contrast is the palette's: the built-in palettes are tested for each as text on the canvas, on a card and on a popover.
A 1.x minor release may add constants to this enum: a switch over it needs a
default branch.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe application's own colour: the palette's accent as text, which isTheme.primary()where that already reads as text on every surface.Something refused or failed: the palette'sdanger.A note: the palette'sinfo.Nothing to call attention to: the palette'smuted text.Something done or accepted: the palette'ssuccess.Something to check: the palette'swarning. -
Method Summary
Modifier and TypeMethodDescriptionThe colour this tone is intheme: what a widget drawing in a tone asks, on every paint.static ToneReturns the enum constant of this class with the specified name.static Tone[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NEUTRAL
Nothing to call attention to: the palette'smuted text. -
ACCENT
The application's own colour: the palette's accent as text, which isTheme.primary()where that already reads as text on every surface. -
INFO
A note: the palette'sinfo. -
SUCCESS
Something done or accepted: the palette'ssuccess. -
WARNING
Something to check: the palette'swarning. -
DANGER
Something refused or failed: the palette'sdanger.
-
-
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
-
colorIn
The colour this tone is intheme: what a widget drawing in a tone asks, on every paint.- Parameters:
theme- the palette to read- Returns:
- the colour
-