diff --git a/include/components/builder.hpp b/include/components/builder.hpp index 30386057..4d39f62d 100644 --- a/include/components/builder.hpp +++ b/include/components/builder.hpp @@ -33,20 +33,19 @@ class builder { void remove_trailing_space(); void font(int index); void font_close(); - void background(string color); + void background(rgba color); void background_close(); - void color(string color); - void color_alpha(string alpha); + void color(rgba color); void color_close(); - void line_color(const string& color); + void line_color(const rgba& color); void line_color_close(); - void overline_color(string color); + void overline_color(rgba color); void overline_color_close(); - void underline_color(string color); + void underline_color(rgba color); void underline_color_close(); - void overline(const string& color = ""); + void overline(const rgba& color = rgba{}); void overline_close(); - void underline(const string& color = ""); + void underline(const rgba& color = rgba{}); void underline_close(); void control(controltag tag); void action(mousebtn index, string action); @@ -56,8 +55,6 @@ class builder { void action_close(); protected: - string background_hex(); - string foreground_hex(); void tag_open(syntaxtag tag, const string& value); void tag_open(attribute attr); diff --git a/include/components/types.hpp b/include/components/types.hpp index 8125d4b6..c1baefa1 100644 --- a/include/components/types.hpp +++ b/include/components/types.hpp @@ -6,6 +6,7 @@ #include #include "common.hpp" +#include "utils/color.hpp" POLYBAR_NS @@ -106,12 +107,12 @@ struct radius { }; struct border_settings { - unsigned int color{0xFF000000}; + rgba color{0xFF000000}; unsigned int size{0U}; }; struct line_settings { - unsigned int color{0xFF000000}; + rgba color{0xFF000000}; unsigned int size{0U}; }; @@ -154,9 +155,9 @@ struct bar_settings { side_values module_margin{0U, 0U}; edge_values strut{0U, 0U, 0U, 0U}; - unsigned int background{0xFF000000}; - unsigned int foreground{0xFFFFFFFF}; - vector background_steps; + rgba background{0xFF000000}; + rgba foreground{0xFFFFFFFF}; + vector background_steps; line_settings underline{}; line_settings overline{}; diff --git a/include/drawtypes/label.hpp b/include/drawtypes/label.hpp index 86b2173f..144446ae 100644 --- a/include/drawtypes/label.hpp +++ b/include/drawtypes/label.hpp @@ -20,10 +20,10 @@ namespace drawtypes { class label : public non_copyable_mixin