You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
452B

  1. #include "app.hpp"
  2. #include "engine.hpp"
  3. namespace rack {
  4. void ColorLightWidget::addColor(NVGcolor c) {
  5. colors.push_back(c);
  6. }
  7. void ColorLightWidget::step() {
  8. color = nvgRGBf(0, 0, 0);
  9. for (int i = 0; i < (int)colors.size(); i++) {
  10. NVGcolor c = colors[i];
  11. float brightness = module->lights[lightId + i].getBrightness();
  12. color.r += c.r * brightness;
  13. color.g += c.g * brightness;
  14. color.b += c.b * brightness;
  15. }
  16. }
  17. } // namespace rack