protected void BlendColors(GetLEDColor getA, GetLEDColor getB, SetLightColor set, int numObjects, int numLEDs) { for (int obj = 0; obj < numObjects; ++obj) { for (int led = 0; led < numLEDs; ++led) { Color b = getA(obj, led); Color a = getB(obj, led); Color newColor = new Color(); newColor.A = (byte)(a.A * m_CurBlendValue + b.A * m_Reciprocal); newColor.R = (byte)(a.R * m_CurBlendValue + b.R * m_Reciprocal); newColor.G = (byte)(a.G * m_CurBlendValue + b.G * m_Reciprocal); newColor.B = (byte)(a.B * m_CurBlendValue + b.B * m_Reciprocal); set(obj, led, newColor); } } }
protected static void RenderLEDs(GetLEDColor get, SetLightColor set, int numObjects, int numLEDs) { for (int obj = 0; obj < numObjects; ++obj) { for (int led = 0; led < numLEDs; ++led) { Color newColor = get(obj, led); set(obj, led, newColor); } } }