From c2452b211dc3f347dbffaac4e6c35b3c3e8c6d65 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Sun, 7 Jan 2024 21:20:02 +0100 Subject: GraphUI Button.setLabelColor(..): Add alpha channel and variant w/ Vec4f for flexibility --- .../classes/com/jogamp/graph/ui/shapes/Button.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/shapes') diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java index 60cdec7fa..635da98ce 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java @@ -332,11 +332,21 @@ public class Button extends BaseButton { return labelNow.getColor(); } - /** Sets the label color. */ - public final Button setLabelColor(final float r, final float g, final float b) { - labelOff.setColor(r, g, b, 1.0f); + /** Sets the label color, consider using alpha 1 */ + public final Button setLabelColor(final Vec4f c) { + labelOff.setColor(c); if( null != labelOn ) { - labelOn.setColor(r, g, b, 1.0f); + labelOn.setColor(c); + } + markShapeDirty(); + return this; + } + + /** Sets the label color, consider using alpha 1 */ + public final Button setLabelColor(final float r, final float g, final float b, final float a) { + labelOff.setColor(r, g, b, a); + if( null != labelOn ) { + labelOn.setColor(r, g, b, a); } markShapeDirty(); return this; -- cgit v1.2.3