Border width of selected window switcher items in pixels. Default is 2.
*osd.window-switcher.style-thumbnail.item.active.border.color*
- Color of border around selected window switcher items. Default is #589bda.
+ Color of border around selected window switcher items.
+ Default is *osd.label.text.color* with 50% opacity.
*osd.window-switcher.style-thumbnail.item.active.bg.color*
- Color of selected window switcher items. Default is #c7e2fc.
+ Color of selected window switcher items.
+ Default is *osd.label.text.color* with 15% opacity.
*osd.window-switcher.style-thumbnail.item.icon.size*
Size of window icons in window switcher items in pixels. Default is 60.
osd.window-switcher.style-thumbnail.item.height: 250
osd.window-switcher.style-thumbnail.item.padding: 10
osd.window-switcher.style-thumbnail.item.active.border.width: 2
-osd.window-switcher.style-thumbnail.item.active.border.color: #589bda
-osd.window-switcher.style-thumbnail.item.active.bg.color: #c7e2fc
+osd.window-switcher.style-thumbnail.item.active.border.color: #706f6d
+osd.window-switcher.style-thumbnail.item.active.bg.color: #bfbcba
osd.window-switcher.style-thumbnail.item.icon.size: 60
osd.window-switcher.preview.border.width: 1
theme->osd_window_switcher_thumbnail.item_height = 250;
theme->osd_window_switcher_thumbnail.item_padding = 10;
theme->osd_window_switcher_thumbnail.item_active_border_width = 2;
- parse_color("#589bda", theme->osd_window_switcher_thumbnail.item_active_border_color);
- parse_color("#c7e2fc", theme->osd_window_switcher_thumbnail.item_active_bg_color);
+ theme->osd_window_switcher_thumbnail.item_active_border_color[0] = FLT_MIN;
+ theme->osd_window_switcher_thumbnail.item_active_bg_color[0] = FLT_MIN;
theme->osd_window_switcher_thumbnail.item_icon_size = 60;
/* inherit settings in post_processing() if not set elsewhere */
return h;
}
+/* Blend foreground color (with new alpha) with background color */
+static void
+blend_color_with_bg(float *dst, float *fg, float fg_a, float *bg)
+{
+ /* Guard against zero division */
+ if (fg[3] <= 0.0f) {
+ memset(dst, 0, sizeof(float) * 4);
+ return;
+ }
+
+ /* Redo premultiplication to update foreground alpha */
+ float new_fg[4] = {
+ fg[0] / fg[3] * fg_a,
+ fg[1] / fg[3] * fg_a,
+ fg[2] / fg[3] * fg_a,
+ fg_a,
+ };
+
+ /* Blend colors */
+ dst[0] = new_fg[0] + bg[0] * (1.0f - new_fg[3]);
+ dst[1] = new_fg[1] + bg[1] * (1.0f - new_fg[3]);
+ dst[2] = new_fg[2] + bg[2] * (1.0f - new_fg[3]);
+ dst[3] = new_fg[3] + bg[3] * (1.0f - new_fg[3]);
+}
+
static void
post_processing(struct theme *theme)
{
memcpy(theme->osd_border_color, theme->osd_label_text_color,
sizeof(theme->osd_border_color));
}
+ if (switcher_thumb_theme->item_active_border_color[0] == FLT_MIN) {
+ blend_color_with_bg(switcher_thumb_theme->item_active_border_color,
+ theme->osd_label_text_color, 0.50, theme->osd_bg_color);
+ }
+ if (switcher_thumb_theme->item_active_bg_color[0] == FLT_MIN) {
+ blend_color_with_bg(switcher_thumb_theme->item_active_bg_color,
+ theme->osd_label_text_color, 0.15, theme->osd_bg_color);
+ }
if (theme->osd_workspace_switcher_boxes_width == 0) {
theme->osd_workspace_switcher_boxes_height = 0;
}