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
488B

  1. #include "app.hpp"
  2. namespace rack {
  3. void MultiLightWidget::addBaseColor(NVGcolor baseColor) {
  4. baseColors.push_back(baseColor);
  5. }
  6. void MultiLightWidget::setValues(const std::vector<float> &values) {
  7. assert(values.size() == baseColors.size());
  8. color = nvgRGBf(0, 0, 0);
  9. for (size_t i = 0; i < baseColors.size(); i++) {
  10. NVGcolor c = baseColors[i];
  11. float value = values[i];
  12. color.r += c.r * value;
  13. color.g += c.g * value;
  14. color.b += c.b * value;
  15. }
  16. }
  17. } // namespace rack