aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-07 21:20:02 +0100
committerSven Göthel <[email protected]>2024-01-07 21:20:02 +0100
commitc2452b211dc3f347dbffaac4e6c35b3c3e8c6d65 (patch)
tree9a0f6b2a196cbdcbca9dbe0ce19bb77bfad16b2a /src/graphui/classes/com/jogamp
parentd80762bdaf79a852cde2391479bb066968ae573c (diff)
GraphUI Button.setLabelColor(..): Add alpha channel and variant w/ Vec4f for flexibility
Diffstat (limited to 'src/graphui/classes/com/jogamp')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java18
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java2
2 files changed, 15 insertions, 5 deletions
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;
diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
index 0ceb9aaa9..2cde62668 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
@@ -233,7 +233,7 @@ public class MediaPlayer extends Widget {
getMultilineTime(Clock.currentMillis(), mPlayer), CtrlButtonWidth, CtrlButtonHeight, zEpsilon);
timeLabel.setName("mp.time");
timeLabel.setPerp().setColor(CtrlCellCol);
- timeLabel.setLabelColor(1, 1, 1);
+ timeLabel.setLabelColor(1, 1, 1, 1.0f);
}
scene.addGLEventListener(new GLEventAdapter() {
long t0 = 0;