Configurable lights

This commit is contained in:
Anuken
2019-11-18 16:58:39 -05:00
parent 5e2dd89d3b
commit 6bc98bbe67
4 changed files with 60 additions and 17 deletions

View File

@@ -12,16 +12,17 @@ public class ColorPicker extends FloatingDialog{
public ColorPicker(){
super("$pickcolor");
shown(this::setup);
}
public void show(Color color, Cons<Color> consumer){
show(color, true, consumer);
}
public void show(Color color, boolean alpha, Cons<Color> consumer){
this.current.set(color);
this.cons = consumer;
show();
}
void setup(){
cont.clear();
cont.pane(t -> {
t.table(Tex.pane, i -> {
@@ -45,13 +46,13 @@ public class ColorPicker extends FloatingDialog{
t.add("B").color(Color.royal);
t.addSlider(0f, 1f, 0.01f, current.b, current::b).width(w);
t.row();
t.add("A");
t.addSlider(0f, 1f, 0.01f, current.a, current::a).width(w);
t.row();
if(alpha){
t.add("A");
t.addSlider(0f, 1f, 0.01f, current.a, current::a).width(w);
t.row();
}
});
buttons.clear();
addCloseButton();
buttons.addImageTextButton("$ok", Icon.checkSmall, () -> {