Package org.jline.utils
Class StyleResolver
java.lang.Object
org.jline.utils.StyleResolver
- Direct Known Subclasses:
StyleResolver
Resolves named (or source-referenced)
AttributedStyle.- Since:
- 3.6
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate AttributedStyleapply(AttributedStyle style, String spec) Apply style specification.private AttributedStyleapplyAnsi(AttributedStyle style, String spec) private AttributedStyleapplyColor(AttributedStyle style, String spec) Apply color styles specification.private AttributedStyleapplyNamed(AttributedStyle style, String name) Apply default named styles.private AttributedStyleapplyReference(AttributedStyle style, String spec) Apply source-referenced named style.private static IntegerReturns the color identifier for the given name.private static IntegerReturns the RGB color for the given name.Resolve the given style specification.Resolve the given style specification.
-
Field Details
-
log
-
source
-
-
Constructor Details
-
StyleResolver
-
-
Method Details
-
colorRgb
Returns the RGB color for the given name.Bright color can be specified with:
!<color>orbright-<color>.Full xterm256 color can be specified with:
~<color>. RGB colors can be specified with:x<rgb>or#<rgb>wherergbis a 24 bits hexadecimal color.- Parameters:
name- the name of the color- Returns:
- color code, or
nullif unable to determine.
-
color
Returns the color identifier for the given name.Bright color can be specified with:
!<color>orbright-<color>.Full xterm256 color can be specified with:
~<color>.- Parameters:
name- the name of the color- Returns:
- color code, or
nullif unable to determine.
-
resolve
Resolve the given style specification.If for some reason the specification is invalid, then
AttributedStyle.DEFAULTwill be used.- Parameters:
spec- the specification- Returns:
- the style
-
resolve
Resolve the given style specification.If this resolves to
AttributedStyle.DEFAULTthen given default specification is used if non-null.- Parameters:
spec- the specificationdefaultSpec- the default specifiaction- Returns:
- the style
-
apply
Apply style specification.- Parameters:
style- the style to apply tospec- the specification- Returns:
- the new style
-
applyAnsi
-
applyReference
Apply source-referenced named style.- Parameters:
style- the style to apply tospec- the specification- Returns:
- the new style
-
applyNamed
Apply default named styles.- Parameters:
style- the style to apply toname- the named style- Returns:
- the new style
-
applyColor
Apply color styles specification.- Parameters:
style- The style to apply tospec- Color specification:<color-mode>:<color-name>- Returns:
- The new style
-