Added gradient classes
This commit is contained in:
@@ -11,7 +11,7 @@ import mightypork.utils.interfaces.Enableable;
|
||||
*
|
||||
* @author Ondřej Hruška (MightyPork)
|
||||
*/
|
||||
public class DelegatingList extends ClientList implements DelegatingClient, Enableable {
|
||||
public class DelegatingList extends ClientList implements DelegatingClient, Enableable, ToggleableClient {
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
@@ -47,6 +47,13 @@ public class DelegatingList extends ClientList implements DelegatingClient, Enab
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isListening()
|
||||
{
|
||||
return isEnabled();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean yes)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package mightypork.utils.math.color;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Linear gradient (each corner can have different color)
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class Grad {
|
||||
|
||||
public final Color leftTop, rightTop, rightBottom, leftBottom;
|
||||
|
||||
|
||||
/**
|
||||
* Create a gradient
|
||||
*
|
||||
* @param leftTop left top color
|
||||
* @param rightTop right top color
|
||||
* @param rightBottom right bottom color
|
||||
* @param leftBottom left bottom color
|
||||
*/
|
||||
public Grad(Color leftTop, Color rightTop, Color rightBottom, Color leftBottom) {
|
||||
this.leftTop = leftTop;
|
||||
this.rightTop = rightTop;
|
||||
this.rightBottom = rightBottom;
|
||||
this.leftBottom = leftBottom;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package mightypork.utils.math.color;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Linear horizontal gradient
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class GradH extends Grad {
|
||||
|
||||
public GradH(Color left, Color right) {
|
||||
super(left, right, right, left);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package mightypork.utils.math.color;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Linear vertical gradient
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class GradV extends Grad {
|
||||
|
||||
public GradV(Color top, Color bottom) {
|
||||
super(top, top, bottom, bottom);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user