Logic-related color functions

This commit is contained in:
Anuken
2022-02-10 11:00:27 -05:00
parent 04c2bbc24d
commit a80e1d86a1
10 changed files with 100 additions and 19 deletions

View File

@@ -17,14 +17,16 @@ public class LogicDisplay extends Block{
public static final byte
commandClear = 0,
commandColor = 1,
commandStroke = 2,
commandLine = 3,
commandRect = 4,
commandLineRect = 5,
commandPoly = 6,
commandLinePoly = 7,
commandTriangle = 8,
commandImage = 9;
//virtual command, unpacked in instruction
commandColorPack = 2,
commandStroke = 3,
commandLine = 4,
commandRect = 5,
commandLineRect = 6,
commandPoly = 7,
commandLinePoly = 8,
commandTriangle = 9,
commandImage = 10;
public int maxSides = 25;
@@ -125,6 +127,8 @@ public class LogicDisplay extends Block{
public enum GraphicsType{
clear,
color,
//virtual
col,
stroke,
line,
rect,
@@ -132,7 +136,7 @@ public class LogicDisplay extends Block{
poly,
linePoly,
triangle,
image;
image,;
public static final GraphicsType[] all = values();
}

View File

@@ -63,7 +63,7 @@ public class LightBlock extends Block{
@Override
public void control(LAccess type, double p1, double p2, double p3, double p4){
if(type == LAccess.color){
color = Color.rgba8888(Mathf.clamp((float)p1), Mathf.clamp((float)p2), Mathf.clamp((float)p3), 1f);
color = Tmp.c1.fromDouble(p1).rgba8888();
}
super.control(type, p1, p2, p3, p4);