focus fade with light palette color

Bug #1918027 reported by Nicolas Capit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sakura
Fix Released
Medium
David Gómez

Bug Description

Hi,

When using a light palette like "Solarized light" with a light background and a dark foreground then the focus fade feature tries to darker the foreground which is already dark.
So it is hard to differentiate fade terminals and not fade terminals.

In this case, I tried to change the source code and change the background color instead of the foreground and it's much better; I did the following hack that only works in my case (it does not work with dark palette colors):

##############################################################
--- a/src/sakura.c
+++ b/src/sakura.c
@@ -308,7 +308,7 @@ struct terminal {
 #define TAB_MIN_SIZE 6
 #define FORWARD 1
 #define BACKWARDS 2
-#define FADE_PERCENT 60
+#define FADE_PERCENT 90
 #define DEFAULT_ADD_TAB_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK)
 #define DEFAULT_DEL_TAB_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK)
 #define DEFAULT_SWITCH_TAB_ACCELERATOR (GDK_CONTROL_MASK)
@@ -2838,12 +2838,12 @@ sakura_fade_out()

        if (!sakura.faded) {
                sakura.faded = true;
- GdkRGBA x = sakura.forecolors[term->colorset];
+ GdkRGBA x = sakura.backcolors[term->colorset];
                x.red = x.red/100.0 * FADE_PERCENT;
                x.green = x.green/100.0 * FADE_PERCENT;
                x.blue = x.blue/100.0 * FADE_PERCENT;
                if ( (x.red >=0 && x.red <=1.0) && (x.green >=0 && x.green <=1.0) && (x.blue >=0 && x.blue <=1.0)) {
- sakura.forecolors[term->colorset]=x;
+ sakura.backcolors[term->colorset]=x;
                } else {
                        SAY("Forecolor value out of range");
                }
@@ -2862,13 +2862,13 @@ sakura_fade_in()

        if (sakura.faded) {
                sakura.faded = false;
- GdkRGBA x = sakura.forecolors[term->colorset];
+ GdkRGBA x = sakura.backcolors[term->colorset];
                //SAY("fade in red %f to %f", x.red, x.red/FADE_PERCENT*100.0);
                x.red = x.red/FADE_PERCENT * 100.0;
                x.green = x.green/FADE_PERCENT * 100.0;
                x.blue = x.blue/FADE_PERCENT * 100.0;
                if ( (x.red >=0 && x.red <=1.0) && (x.green >=0 && x.green <=1.0) && (x.blue >=0 && x.blue <=1.0)) {
- sakura.forecolors[term->colorset]=x;
+ sakura.backcolors[term->colorset]=x;
                } else {
                        SAY("Forecolor value out of range");
                }
##############################################################

I don't know what can be done to handle all the palette colors (dark and light) easily.
But in the current state, only dark palette colors are working with the fade focus functionality.

Revision history for this message
David Gómez (dabisu) wrote :

Actually the "Solarized light" support is broken right now. When I fix it (hopefully soon) I'll keep in mind this and make fade work as expected for light palettes.

Thanks for you report!

Changed in sakura:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → David Gómez (dabisu)
Revision history for this message
David Gómez (dabisu) wrote :

In the last release (3.8.0) palette configuration has been reworked and Solarized Light now works as expected. Also, already available in the repository, the fade feature is completely different and now should work consistently both with dark and light palettes.

Changed in sakura:
status: Confirmed → Fix Committed
David Gómez (dabisu)
Changed in sakura:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.