#include "ardour/rc_configuration.h" // for widget prelight preference
#include "canvas/utils.h"
+#include "canvas/colors.h"
#include "ardour_button.h"
#include "ardour_ui.h"
return;
}
std::string name = get_name();
+ bool failed = false;
- fill_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill active", name));
- fill_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill", name));
+ fill_active_color = ARDOUR_UI::config()->color (string_compose ("%1: fill active", name), &failed);
+ if (failed) {
+ fill_active_color = ARDOUR_UI::config()->color ("generic button: fill active");
+ }
+ fill_inactive_color = ARDOUR_UI::config()->color (string_compose ("%1: fill", name), &failed);
+ if (failed) {
+ fill_inactive_color = ARDOUR_UI::config()->color ("generic button: fill");
+ }
+
+ text_active_color = ArdourCanvas::contrasting_text_color (fill_active_color);
+ text_inactive_color = ArdourCanvas::contrasting_text_color (fill_inactive_color);
+
+ led_active_color = ARDOUR_UI::config()->color (string_compose ("%1: led active", name), &failed);
+ if (failed) {
+ led_active_color = ARDOUR_UI::config()->color ("generic button: led active");
+ }
- text_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: text active", name));
- text_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: text", name));
+ /* The inactive color for the LED is just a fairly dark version of the
+ * active color.
+ */
+
+ ArdourCanvas::HSV inactive (led_active_color);
+ inactive.v = 0.35;
- led_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led active", name));
- led_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led", name));
+ led_inactive_color = inactive.color ();
}
/**