Package dev.boze.api.render
Class ClientColor
java.lang.Object
dev.boze.api.render.ClientColor
Represents a color provided by the client.
Concrete instances wrap client-side color implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidchoose(ClientColorBinding binding) Binds the given consumer to this color.abstract ClientColorcopy()abstract voiddelete()Deletes the underlying color if possible.abstract intgetBlue()Gets the blue component of this color (0-255).abstract intgetGreen()Gets the green component of this color (0-255).abstract Stringabstract intGets the packed RGB value of this color (0xRRGGBB).abstract intgetRed()Gets the red component of this color (0-255).abstract voidunchoose(ClientColorBinding binding) Removes the given consumer binding from this color.
-
Constructor Details
-
ClientColor
public ClientColor()
-
-
Method Details
-
getIdentifier
- Returns:
- Identifier for this color.
Registered colors return their entry name. Defaults use
_defaultfor static/changing selections and_default_<gradient id>for gradients.
-
copy
- Returns:
- Lightweight copy referencing the same underlying client color
-
choose
Binds the given consumer to this color. The concrete implementation is responsible for forwarding the binding to the underlying color system.- Parameters:
binding- Binding owner that should be notified about deletions
-
unchoose
Removes the given consumer binding from this color.- Parameters:
binding- Binding owner
-
delete
public abstract void delete()Deletes the underlying color if possible. Implementations should follow the same semantics as the client color system. -
getRed
public abstract int getRed()Gets the red component of this color (0-255).- Returns:
- The red component value
-
getGreen
public abstract int getGreen()Gets the green component of this color (0-255).- Returns:
- The green component value
-
getBlue
public abstract int getBlue()Gets the blue component of this color (0-255).- Returns:
- The blue component value
-
getPacked
public abstract int getPacked()Gets the packed RGB value of this color (0xRRGGBB).- Returns:
- The packed RGB value
-