private void SetColor(HSVChannel hsvChannel, float channelValue, ref Color currentColor, bool isBaseColor) { float H, S, V; Color.RGBToHSV(currentColor, out H, out S, out V); switch (hsvChannel) { case HSVChannel.Hue: this.SetColor(Color.HSVToRGB(channelValue, S, V, !isBaseColor), ref currentColor, isBaseColor); break; case HSVChannel.Saturation: this.SetColor(Color.HSVToRGB(H, channelValue, V, !isBaseColor), ref currentColor, isBaseColor); break; case HSVChannel.Value: this.SetColor(Color.HSVToRGB(H, S, channelValue, !isBaseColor), ref currentColor, isBaseColor); break; } }
public void SetEmissionColor(HSVChannel hsvChannel, float channelValue) => this.SetColor(hsvChannel, channelValue, ref this.emissionColor, false);
public void SetBaseColor(HSVChannel hsvChannel, float channelValue) => this.SetColor(hsvChannel, channelValue, ref this.baseColor, true);