mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 14:39:27 +01:00
add mixbox for java
This commit is contained in:
1
java/examples/HelloMixbox.bat
Normal file
1
java/examples/HelloMixbox.bat
Normal file
@@ -0,0 +1 @@
|
||||
java -cp ../mixbox.jar HelloMixbox.java
|
||||
14
java/examples/HelloMixbox.java
Normal file
14
java/examples/HelloMixbox.java
Normal file
@@ -0,0 +1,14 @@
|
||||
import java.awt.Color;
|
||||
import com.scrtwpns.Mixbox;
|
||||
|
||||
class HelloMixbox {
|
||||
public static void main(String[] args) {
|
||||
Color color1 = new Color(0, 33, 133); // blue
|
||||
Color color2 = new Color(252, 211, 0); // yellow
|
||||
float t = 0.5f; // mixing ratio
|
||||
|
||||
Color colorMix = new Color(Mixbox.lerp(color1.getRGB(), color2.getRGB(), t));
|
||||
|
||||
System.out.print(colorMix);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user