mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-19 02:25:10 +01:00
MidnightLib v0.2.0 for 21w19a
- MidnightConfig screens can be viewed from a new screen in the minecraft options - Code cleanup - Examples & Documentation - New Methods - Upgrade to 21w19a and Java 16 MidnightConfig v1.0.0: - The config screen no longer shows the entries of all instances of MidnightConfig - Compatible with servers! - Scrollable! - Comment support! - Fresh new design
This commit is contained in:
17
src/main/java/eu/midnightdust/lib/util/MidnightColorUtil.java
Executable file
17
src/main/java/eu/midnightdust/lib/util/MidnightColorUtil.java
Executable file
@@ -0,0 +1,17 @@
|
||||
package eu.midnightdust.lib.util;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class MidnightColorUtil {
|
||||
/**
|
||||
* @credit https://stackoverflow.com/questions/4129666/how-to-convert-hex-to-rgb-using-java
|
||||
* @param colorStr e.g. "FFFFFF"
|
||||
* @return Color as RGB
|
||||
*/
|
||||
public static Color hex2Rgb(String colorStr) {
|
||||
return new Color(
|
||||
Integer.valueOf( colorStr.substring( 0, 2 ), 16 ),
|
||||
Integer.valueOf( colorStr.substring( 2, 4 ), 16 ),
|
||||
Integer.valueOf( colorStr.substring( 4, 6 ), 16 ));
|
||||
}
|
||||
}
|
||||
7
src/main/java/eu/midnightdust/lib/util/MidnightMathUtil.java
Executable file
7
src/main/java/eu/midnightdust/lib/util/MidnightMathUtil.java
Executable file
@@ -0,0 +1,7 @@
|
||||
package eu.midnightdust.lib.util;
|
||||
|
||||
public class MidnightMathUtil {
|
||||
public static boolean isEven(int i) {
|
||||
return (i | 1) > i;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user