public override Color16Bit Filter(Color16Bit origColor) { HslColor hsl = new HslColor(origColor.ToRGBColor()); if (hsl.L > (1.0 - (double)Properties.Settings.Default.amountToLighten)) hsl.L = 1.0; else hsl.L += (double)Properties.Settings.Default.amountToLighten; return new Color16Bit(hsl.ToRgbColor()); }
public override Color16Bit Filter(Color16Bit origColor) { // Too dark to saturate with good results if (origColor.red < 5000 && origColor.green < 5000 && origColor.blue < 5000) return origColor; HslColor boringHSL = new HslColor(origColor.ToRGBColor()); double satAmnt = (double)Properties.Settings.Default.saturationAmount; double diff = Math.Abs(.5 - boringHSL.L); int dir = boringHSL.L > .5 ? -1 : 1; if (diff < satAmnt) boringHSL.L = .5; else boringHSL.L += dir * satAmnt; return new Color16Bit(boringHSL.ToRgbColor()); }
private void target() { int h = 0; while (this.IsRunning) { h += 1; h %= 360; HslColor col = new HslColor(h, 1, .5); if (NewColorAvailEvent != null) { NewColorAvailEvent(new Color16Bit(col.ToRgbColor()), deviceId, index++); } if (stepSleep != 0) Thread.Sleep(stepSleep); } }