|
@@ -13,11 +13,20 @@ public class CombineColorNode : Node
|
|
|
|
|
|
public InputProperty<CombineSeparateColorMode> Mode { get; }
|
|
|
|
|
|
- public FuncInputProperty<Float1> R { get; }
|
|
|
+ /// <summary>
|
|
|
+ /// Represents either Red 'R' or Hue 'H' depending on <see cref="Mode"/>
|
|
|
+ /// </summary>
|
|
|
+ public FuncInputProperty<Float1> V1 { get; }
|
|
|
|
|
|
- public FuncInputProperty<Float1> G { get; }
|
|
|
+ /// <summary>
|
|
|
+ /// Represents either Green 'G' or Saturation 'S' depending on <see cref="Mode"/>
|
|
|
+ /// </summary>
|
|
|
+ public FuncInputProperty<Float1> V2 { get; }
|
|
|
|
|
|
- public FuncInputProperty<Float1> B { get; }
|
|
|
+ /// <summary>
|
|
|
+ /// Represents either Blue 'B', Value 'V' or Lightness 'L' depending on <see cref="Mode"/>
|
|
|
+ /// </summary>
|
|
|
+ public FuncInputProperty<Float1> V3 { get; }
|
|
|
|
|
|
public FuncInputProperty<Float1> A { get; }
|
|
|
|
|
@@ -26,9 +35,9 @@ public class CombineColorNode : Node
|
|
|
Color = CreateFuncOutput(nameof(Color), "COLOR", GetColor);
|
|
|
Mode = CreateInput("Mode", "MODE", CombineSeparateColorMode.RGB);
|
|
|
|
|
|
- R = CreateFuncInput<Float1>("R", "R", 0d);
|
|
|
- G = CreateFuncInput<Float1>("G", "G", 0d);
|
|
|
- B = CreateFuncInput<Float1>("B", "B", 0d);
|
|
|
+ V1 = CreateFuncInput<Float1>("R", "R", 0d);
|
|
|
+ V2 = CreateFuncInput<Float1>("G", "G", 0d);
|
|
|
+ V3 = CreateFuncInput<Float1>("B", "B", 0d);
|
|
|
A = CreateFuncInput<Float1>("A", "A", 0d);
|
|
|
}
|
|
|
|
|
@@ -42,9 +51,9 @@ public class CombineColorNode : Node
|
|
|
|
|
|
private Half4 GetRgb(FuncContext ctx)
|
|
|
{
|
|
|
- var r = ctx.GetValue(R);
|
|
|
- var g = ctx.GetValue(G);
|
|
|
- var b = ctx.GetValue(B);
|
|
|
+ var r = ctx.GetValue(V1);
|
|
|
+ var g = ctx.GetValue(V2);
|
|
|
+ var b = ctx.GetValue(V3);
|
|
|
var a = ctx.GetValue(A);
|
|
|
|
|
|
return ctx.NewHalf4(r, g, b, a);
|
|
@@ -52,9 +61,9 @@ public class CombineColorNode : Node
|
|
|
|
|
|
private Half4 GetHsv(FuncContext ctx)
|
|
|
{
|
|
|
- var h = ctx.GetValue(R);
|
|
|
- var s = ctx.GetValue(G);
|
|
|
- var v = ctx.GetValue(B);
|
|
|
+ var h = ctx.GetValue(V1);
|
|
|
+ var s = ctx.GetValue(V2);
|
|
|
+ var v = ctx.GetValue(V3);
|
|
|
var a = ctx.GetValue(A);
|
|
|
|
|
|
return ctx.HsvaToRgba(h, s, v, a);
|
|
@@ -62,9 +71,9 @@ public class CombineColorNode : Node
|
|
|
|
|
|
private Half4 GetHsl(FuncContext ctx)
|
|
|
{
|
|
|
- var h = ctx.GetValue(R);
|
|
|
- var s = ctx.GetValue(G);
|
|
|
- var l = ctx.GetValue(B);
|
|
|
+ var h = ctx.GetValue(V1);
|
|
|
+ var s = ctx.GetValue(V2);
|
|
|
+ var l = ctx.GetValue(V3);
|
|
|
var a = ctx.GetValue(A);
|
|
|
|
|
|
return ctx.HslaToRgba(h, s, l, a);
|