Interface GuiPaint
public interface GuiPaint
What a shape or text is filled with: a plain ARGB color, an HSB color, one of the user's client
colors at some opacity, or a gradient between two of those. Changing and gradient client colors
keep animating when drawn.
-
Method Summary
Modifier and TypeMethodDescriptionfloatalpha()intargb()static GuiPaintargb(int argb) static GuiPainthorizontal(GuiPaint start, GuiPaint end) A gradient fromstartat the left edge of whatever it fills toendat the right edge.static GuiPainthsb(float hue, float saturation, float brightness, float alpha) An HSB color.static GuiPaintof(ColorOption.Value value) static GuiPaintof(ClientColor color, float alpha) static GuiPaintrgb(int rgb, float alpha) static GuiPaintA gradient fromstartat the top edge of whatever it fills toendat the bottom edge.withAlpha(float alpha)
-
Method Details
-
argb
- Parameters:
argb- Color with alpha in the top byte- Returns:
- The paint
-
rgb
- Parameters:
rgb- Color without alphaalpha- Opacity, 0 to 1- Returns:
- The paint
-
hsb
An HSB color. Gradients between HSB paints blend hue, saturation and brightness instead of red, green and blue, which is what color pickers need.- Parameters:
hue- 0 to 1saturation- 0 to 1brightness- 0 to 1alpha- 0 to 1- Returns:
- The paint
-
of
- Parameters:
color- A client coloralpha- Opacity, 0 to 1- Returns:
- The paint
-
of
- Parameters:
value- A color option's value, drawn at its fill opacity- Returns:
- The paint
-
horizontal
A gradient fromstartat the left edge of whatever it fills toendat the right edge. Seevertical(GuiPaint, GuiPaint)for how gradients behave.- Returns:
- The paint
-
vertical
A gradient fromstartat the top edge of whatever it fills toendat the bottom edge.
Shapes and outlines are shaded across their own bounds; text, icons and lines usestart. The ends blend instart's color space, so between HSB colors hue, saturation and brightness are blended. When either end is a client gradient color, the fill usesstartalone.alpha()andargb()describestart, andwithAlpha(float)gives both ends that opacity.- Returns:
- The paint
-
alpha
float alpha()- Returns:
- Opacity, 0 to 1
-
withAlpha
- Parameters:
alpha- New opacity, 0 to 1- Returns:
- A copy with this opacity
-
argb
int argb()- Returns:
- The color as ARGB right now. Changing colors are sampled at the current time; gradients give their first color.
-