Interface TextStyle

All Superinterfaces:
Buildable<TextStyle,TextStyle.Builder>

@Immutable public interface TextStyle extends Buildable<TextStyle,TextStyle.Builder>
Represents the styling of the text contained in a component.
  • Method Details

    • of

      static TextStyle of(@Nullable ComponentColor textColor, @Nullable ComponentColor backColor, Map<TextDecoration,Boolean> decorations)
      Creates a new text style with the given colors and decorations.
      Parameters:
      textColor - the text color
      backColor - the background color
      decorations - the decorations
      Returns:
      the text style
    • of

      static TextStyle of(@Nullable ComponentColor textColor, @Nullable ComponentColor backColor)
      Creates a new text style with the given colors.
      Parameters:
      textColor - the text color
      backColor - the background color
      Returns:
      the text style
    • of

      static TextStyle of(@Nullable ComponentColor textColor)
      Creates a new text style with the given text color.
      Parameters:
      textColor - the text color
      Returns:
      the text style
    • of

      static TextStyle of(@Nullable ComponentColor textColor, TextDecoration... decorations)
      Creates a new text style with the given text color and decorations.
      Parameters:
      decorations - the decorations
      Returns:
      the text style
    • of

      static TextStyle of(Map<TextDecoration,Boolean> decorations)
      Creates a new text style with the given decorations.
      Parameters:
      decorations - the decorations
      Returns:
      the text style
    • of

      static TextStyle of(TextDecoration... decorations)
      Creates a new text style with the given decorations.
      Parameters:
      decorations - the decorations
      Returns:
      the text style
    • none

      static TextStyle none()
      Returns a text style with no styling.
    • builder

      static TextStyle.Builder builder()
      Creates a new text style builder.
    • getTextColor

      @Nullable ComponentColor getTextColor()
      Returns the text color of this style.
    • getBackColor

      @Nullable ComponentColor getBackColor()
      Returns the background color of this style.
    • getDecorations

      Map<TextDecoration,Boolean> getDecorations()
      Returns the decorations of this style.
    • merge

      default TextStyle merge(TextStyle other)
      Merges this text style with another one, overriding existing values.
      Parameters:
      other - the style to merge
      Returns:
      the merged text style
    • toBuilder

      default TextStyle.Builder toBuilder()
      Specified by:
      toBuilder in interface Buildable<TextStyle,TextStyle.Builder>