Package dev.oumaimaa.kawaiiapi.colors
Class ColorTranslator.ColorBuilder
java.lang.Object
dev.oumaimaa.kawaiiapi.colors.ColorTranslator.ColorBuilder
- Enclosing class:
ColorTranslator
Builder class for creating complex colored text using method chaining.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends text with a specific color code.Appends colored text using legacy color codes.Appends text with a hex color.@NotNull net.kyori.adventure.text.Componentbuild()Builds and returns the final Component.@NotNull StringBuilds and returns the final legacy formatted string.newLine()Appends a new line.
-
Constructor Details
-
ColorBuilder
public ColorBuilder()
-
-
Method Details
-
append
Appends colored text using legacy color codes.- Parameters:
coloredText- Text with color codes- Returns:
- This builder instance
-
append
Appends text with a specific color code.- Parameters:
color- The color code (without &)content- The text content- Returns:
- This builder instance
-
appendHex
public ColorTranslator.ColorBuilder appendHex(@NotNull @NotNull String hexColor, @NotNull @NotNull String content) Appends text with a hex color.- Parameters:
hexColor- The hex color (e.g., "FF0000")content- The text content- Returns:
- This builder instance
-
newLine
-
build
@NotNull public @NotNull net.kyori.adventure.text.Component build()Builds and returns the final Component.- Returns:
- The constructed Component
-
buildLegacy
Builds and returns the final legacy formatted string.- Returns:
- The constructed string
-