public void PwmColor(float r, float g, float b) { PiBlaster.Set(PinRed, r); PiBlaster.Set(PinGreen, g); PiBlaster.Set(PinBlue, b); ValRed = r; ValGreen = g; ValBlue = b; }
private void SetColorInstant(Color color, double luminance = 1, bool setCurrentColor = true) { this.CurrentColor = color; var rPwm = (float)(color.R * luminance) / 255.0f; var gPwm = (float)(color.G * luminance) / 255.0f; var bPwm = (float)(color.B * luminance) / 255.0f; PiBlaster.Set(PinRed, rPwm); PiBlaster.Set(PinGreen, gPwm); PiBlaster.Set(PinBlue, bPwm); ValRed = rPwm; ValGreen = gPwm; ValBlue = bPwm; }