1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-21 07:44:49 +00:00

Allow passing RGB8 hex values to term.setColour

This commit is contained in:
Lignum
2017-05-07 01:16:48 +02:00
parent 1cc403191f
commit 287c6f172c
4 changed files with 57 additions and 26 deletions

View File

@@ -53,7 +53,7 @@ public class Palette
}
}
private static int encodeRGB8( float[] rgb )
public static int encodeRGB8( float[] rgb )
{
int r = (int)( rgb[0] * 255 ) & 0xFF;
int g = (int)( rgb[1] * 255 ) & 0xFF;
@@ -62,7 +62,7 @@ public class Palette
return ( r << 16 ) | ( g << 8 ) | b;
}
private static float[] decodeRGB8( int rgb )
public static float[] decodeRGB8( int rgb )
{
return new float[]
{