Package me.croabeast.prismatic.color
Interface ColorPattern
public interface ColorPattern
Low-level contract for Prismatic color-pattern processors.
Implementations transform raw strings by either applying or stripping Prismatic-specific color syntax
such as gradients, rainbows and single RGB markers. Most plugin code should prefer
PrismaticAPI rather than interacting with this SPI directly.
The built-in processors are exposed through MULTI, SINGLE and
COLOR_PATTERNS.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<ColorPattern> Immutable ordered list of the built-in processors used by the default Prismatic pipeline.static final ColorPatternBuilt-in processor for gradients, rainbows and other multi-color Prismatic tags.static final ColorPatternBuilt-in processor for single RGB tokens such as{#ff8800}or&#ff8800. -
Method Summary
-
Field Details
-
MULTI
Built-in processor for gradients, rainbows and other multi-color Prismatic tags. -
SINGLE
Built-in processor for single RGB tokens such as{#ff8800}or&#ff8800. -
COLOR_PATTERNS
Immutable ordered list of the built-in processors used by the default Prismatic pipeline.The order is always:
- multi-color (gradients/rainbows)
- single-color
-
-
Method Details
-
strip
Removes the syntax handled by this pattern from a string.- Parameters:
string- the text from which to remove color formatting- Returns:
- the plain text string with all color codes removed
-
apply
Applies this pattern to a string.The
legacyflag allows implementations to choose between exact RGB output and downsampled legacy Bukkit colors.- Parameters:
string- the input text to which the color pattern will be appliedlegacy-trueif legacy formatting (e.g. 16-color mode) should be used;falsefor modern RGB support- Returns:
- the transformed, colorized string
-