public override UnityEngine.Color GetColour(double x, double y) { UnityEngine.Color col1 = SourceModule.GetColour(x, y); float hueChange = (float)HueModule.GetValue(x, y); float satChange = (float)SatModule.GetValue(x, y); float lumChange = (float)LumModule.GetValue(x, y); // Read hsl: float h = col1.r; float s = col1.g; float l = col1.b; HslRgb.ToHsl(ref h, ref s, ref l); // Boost all 3: h = (h + hueChange) % 1f; s *= 1f + satChange; l *= 1f + lumChange; // Back to colour: HslRgb.ToRgb(ref h, ref s, ref l); // Now RGB: col1.r = h; col1.g = s; col1.b = l; return(col1); }
public override UnityEngine.Color GetColour(double x, double y) { // Read H: float h = (float)HueModule.GetValue(x, y); // Read S: float s = (float)SaturationModule.GetValue(x, y); // Read V: float v = (float)BrightModule.GetValue(x, y); // Convert to RGB: HsvRgb.ToRgb(ref h, ref s, ref v); // Now RGB. return(new Color(h, s, v, 1f)); }
public override UnityEngine.Color GetColour(double x, double y) { // Read H: float h = (float)HueModule.GetValue(x, y); // Read S: float s = (float)SaturationModule.GetValue(x, y); // Read L: float l = (float)LumModule.GetValue(x, y); // Convert to RGB: HslRgb.ToRgb(ref h, ref s, ref l); // Now RGB. return(new Color(h, s, l, 1f)); }