Pegasus Mail Suggestions
Mail Editor - Users with non-white window background in Windows - how Pegasus currently handles it and suggestion

Thank you both for the suggestions re. changing the colour tone of Windows 10 to reduce the amount of blue and lower the colour temperature.  I am already doing something similar. 

Specifically:

* I have [url=https://www.groovypost.com/howto/calibrate-monitor-color-display-windows-10/]calibrated the monitor colours[/url] to have overall less blue, similar to Windows Night Light - carefully done to preserve relative colour accuracy, so photos and movies etc still look good.  This is similar to having f.lux or the Win10 Night Light enabled all the time.  I don't change it at different times of day.  Technologically this is also a good solution because colour calibration is done through the graphics card, so it automatically applies to everything (full screen movies, games, etc).  Specifically, Windows uploads the colour calibration profile to the graphics card when Windows starts, and then the graphics card does the rest.

* Windows 10 apps are [url=https://www.howtogeek.com/222614/how-to-enable-windows-10s-hidden-dark-theme/]set to use Dark Mode where possible[/url] - since the March 2019 update this includes folder windows (Windows Explorer) and most - but not all - Windows 10 components

* I have set the Windows 10 accent colours to something dark 

* Windows 10 [url=https://www.softpedia.com/get/System/OS-Enhancements/Classic-Color-Panel.shtml]system colours are set[/url] to a generally dark palette chosen by me, for example window borders and title bars are dark.  For reasons already explained, I do not choose a full "white text on black background" colour here because that breaks a few applications (hard-coded black text would become invisible with a black system background).  Obviously I do not want to be changing my Windows system colours for each different application I use, anyhow Windows requires a re-logon to update the colour palette so that would be practically impossible.  The best compromise is black text on a mid-range background.  The mid-range Windows system background colour is giving rise to the severity of the Pmail colour issue raised in this suggestion.

* I have disabled Cortana in the Windows 10 task bar (an ugly white search box)

* A nice Chrome extension, Stylish, allows the colour scheme of any website to be over-ridden by a user style.  Stylish is a popular tool and therefore the community has created good 'dark' user style for many popular websites, which you can choose and activate for each site, so I have these for Google, StackOverflow, Github and others that I use regularly, all of which have the tyrannical black text on a white background.

 

I should probably write a blog post about all this, if I had a blog...

<p>Thank you both for the suggestions re. changing the colour tone of Windows 10 to reduce the amount of blue and lower the colour temperature.  I am already doing something similar.<span style="font-size: 10pt;"> </span></p><p>Specifically:</p><p><span style="font-size: 10pt;">* I have [url=</span><span style="font-size: 13.3333px;">https://www.groovypost.com/howto/calibrate-monitor-color-display-windows-10/]</span><span style="font-size: 10pt;">calibrated the monitor colours[/url] to have overall less blue, similar to Windows Night Light - carefully done to preserve relative colour accuracy, so photos and movies etc still look good.  This is similar to having f.lux or the Win10 Night Light enabled all the time.  I don't change it at different times of day.  Technologically this is also a good solution because colour calibration is done through the graphics card, so it automatically applies to everything (full screen movies, games, etc).  Specifically, Windows uploads the colour calibration profile to the graphics card when Windows starts, and then the graphics card does the rest.</span></p><p><span style="font-size: 10pt;">* Windows 10 apps are [url=</span><span style="font-size: 13.3333px;">https://www.howtogeek.com/222614/how-to-enable-windows-10s-hidden-dark-theme/]</span><span style="font-size: 10pt;">set to use Dark Mode where possible[/url] - since the March 2019 update this includes folder windows (Windows Explorer) and most - but not all - Windows 10 components</span></p><p>* I have set the Windows 10 accent colours to something dark </p><p><span style="font-size: 10pt;">* Windows 10 [url=</span><span style="font-size: 13.3333px;">https://www.softpedia.com/get/System/OS-Enhancements/Classic-Color-Panel.shtml]</span><span style="font-size: 10pt;">system colours are set[/url] to a generally dark palette chosen by me, for example window borders and title bars are dark.  For reasons already explained, I do not choose a full "white text on black background" colour here because that breaks a few applications (hard-coded black text would become invisible with a black system background).  Obviously I do not want to be changing my Windows system colours for each different application I use, anyhow Windows requires a re-logon to update the colour palette so that would be practically impossible.  The best compromise is black text on a mid-range background.  </span><b style="font-size: 10pt;">The mid-range Windows system background colour is giving rise to the severity of the Pmail colour issue raised in this suggestion.</b></p><p>* I have disabled Cortana in the Windows 10 task bar (an ugly white search box)</p><p>* A nice Chrome extension, [url=https://chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe]Stylish[/url], allows the colour scheme of any website to be over-ridden by a user style.  Stylish is a popular tool and therefore the community has created good 'dark' user style for many popular websites, which you can choose and activate for each site, so I have these for Google, StackOverflow, Github and others that I use regularly, all of which have the <i>[i]tyrannical[/i] </i>black text on a white background.</p><p> </p><p>I should probably write a blog post about all this, if I had a blog...</p>

Please see this thread and this screenshot:

 

The system default window background colour is set in Windows Registry (or by colour setting apps).  In Windows, although the default is white (255 255 255 or #FFFFFF), it could of course be any colour.  Visually impaired people may change to a high contrast colour scheme.  People who use their PC a lot in the evening or night often prefer darker themes.  Some people just don't like a screen full of white.  There are good reasons for this, including reducing eye-strain.

In Win10 the precise registry key is:

[HKEY_CURRENT_USER\Control Panel\Colors]

"Window"= for the background colour

"WindowText" for the foreground colour.

  

As explained in my above-linked post and screenshot, it looks like Pegasus' current approach is to notice the system background colour and automatically set the on-screen colour for certain screen elements to try to achieve high contrast.  So Pegasus has programmatically chosen the nasty pale brown brown text colour you are seeing in the screenshot posted.

Specifically, in the New Mail editor, the default text colour on screen (i.e. the colour seen when no style is used to change the text colour) is done like this, and you can also see in the screenshot that this is the colour of the cursor at the end of the message.  This also applies to the colour of any unstyled text in a quoted message, for example when writing a mail in reply to an email.   Maybe this is also seen in other on-screen elements in Pegasus when no other colour is set, I have not checked everything.

Pegasus is setting the on-screen text colour using the formula: (#FFFFFF - window background colour).

It's a nice idea to take some control of text colours, in cases where the window background colour is not white.  But the implementation is poor.  Specifically, the closer the window background colour is to a mid-range colour like #808080, the weaker the contrast becomes when Pegasus uses this approach.  The weaker contrast increases eye-strain.

In my case, ideally I would like to set a black background colour #000000 in Windows.  But that approach falls down in a lot of applications and websites, if the programmer has hard-coded a text colour (e.g. black) for a window, menu or other on-screen element, but allowed the application to use Windows system background colour.  Regrettably, that's very common.  Also, plenty of other applications have hard-coded colours for other on-screen elements assuming a white window background.  It's inconsiderate, especially to visually impaired people or people like me with old eyes.  But to avoid pain with all those applications, the best I can do in practice is choose a mid-range colour - it's not fully white, but it still gives high contrast in the majority of applications which want to present information and menu text in black, dark grey, or other dark colours.  Using a mid-range colour as the background in Windows, unfortunately gives rise to the contrast problem in Pegasus.

 

My suggestion is that Pegasus should do one or more of the following four things:

1.   Use the Windows system text colour, whenever displaying text on a background which is the Windows system background colour.  This works, because normally, anyone who has changed the Windows system background colour will also have changed the text colour to something which gives them enough contrast.   This is fairly conventional and my preferred approach.

2.   Provide a setting for the user to choose the on-screen colour for text elements, instead of setting it programmatically.   (But I understand that adding any setting requires a lot of UI coding and redesign, and the more settings there are in the application, the more complex the application becomes for other users.)   

3.   Provide a configuration option in PMAIL.INI which can control this behaviour and which can be edited manually by anyone who needs to.

4.   Use a better algorithm for picking a high contrast colour, instead of (#FFFFFF - background).   As explained in the linked article above, for a first pass, black text looks best on any background which is brighter than #808080, white text looks best on any darker background.  For a more sophisticated second pass approach, instead of setting the cut-off at #808080 (and it's going to be hard to determine if a colour like #2080A0 is brighter or darker than that), you could calculate the luminance of the background colour.

In my own work I use the following Java code to calculate relative luminance from a standard Windows colour value like #FFFFFF, i.e. an integer RGB colour.  It involves several steps as you have to convert to sRGB first.  You are welcome to use this code in PMail.

 

public static double luminanceRelative(int c)

{

float rgb[] = rgbToFloatArray(c);

double sRGB[] = rgbToSRGB(rgb);

return luminanceSRGB(sRGB);

}

private static float[] rgbToFloatArray(int c)

{

int g = c >> 8;

int r = g >> 8;

g = g & 0xff;

int b = c & 0xff;

float f[] = { r / 255F, g / 255F, b / 255F };

return f;

}


private static double[] rgbToSRGB(float[] rgb)

{

double sRGB[] = new double[3];

int i = 0;

for (float f : rgb) {

if (f > 0.03928F) sRGB = Math.pow((f + 0.055) / 1.055, 2.4);

else sRGB = f / 12.92;

i++;

}

return sRGB;

}

private static double luminanceSRGB(double[] sRGB)

{

return 0.2126 * sRGB[0] + 0.7152 * sRGB[1] + 0.0722 * sRGB[2];

}

 

<p>Please see <span style="font-size: 10pt;">[url=http://community.pmail.com/forums/51857/ShowThread.aspx#51857]this thread[/url] </span><span style="font-size: 10pt;">and this screenshot:</span></p><p>[img]http://i.imgur.com/5JfqYMq.jpg[/img]</p><p><span style="font-size: 10pt;"> </span></p><p>The system default window background colour is set in Windows Registry (or by colour setting apps).  In Windows, although the default is white (255 255 255 or #FFFFFF), it could of course be any colour.  Visually impaired people may change to a high contrast colour scheme.  People who use their PC a lot in the evening or night often prefer darker themes.  Some people just don't like a screen full of white.  <span style="font-size: 10pt;">[url=http://www.maketecheasier.com/are-dark-themes-better-for-eyes-battery/]There are good reasons for this, including reducing eye-strain.</span><span style="font-size: 10pt;">[/url]</span></p><p><span style="font-size: 10pt;">In Win10 the precise registry key is:</span></p><p><span style="font-size: 10pt;"> [HKEY_CURRENT_USER\Control Panel\Colors]</span></p><p>"Window"=<span style="font-size: 10pt;"> for the background colour</span></p><p>"WindowText" for the foreground colour.</p><p> <span style="font-size: 10pt;"> </span></p><p>As explained in my above-linked post and screenshot, it looks like Pegasus' current approach is to notice the system background colour and automatically set the on-screen colour for certain screen elements to try to achieve high contrast.  So Pegasus has programmatically chosen the nasty pale brown brown text colour you are seeing in the screenshot posted.</p><p>Specifically, in the New Mail editor, <span style="font-size: 10pt;">the default text </span><span style="font-size: 10pt;">colour on screen (i.e. the colour seen when no style is used to change the text colour) is done like this, and you can also see in the screenshot that this is the colour of the cursor at the end of the message.  This also applies to the </span><span style="font-size: 10pt;">colour of any unstyled text in a quoted message, for example when writing a mail in reply to an email.   Maybe this is also seen in other on-screen elements in Pegasus when no other colour is set, I have not checked everything.</span></p><p>Pegasus is setting the on-screen text colour using the formula: (#FFFFFF - window background colour).</p><p>It's a nice idea to take some control of text colours, in cases where the window background colour is not white.  But the implementation is poor.  Specifically, the closer the window background colour is to a mid-range colour like #808080, the weaker the contrast becomes when Pegasus uses this approach.  The weaker contrast increases eye-strain.</p><p>In my case, ideally I would like to set a black background colour #000000 in Windows.  But that approach falls down in a lot of applications and websites, if the programmer has hard-coded a text colour (e.g. black) for a window, menu or other on-screen element, but allowed the application to use Windows system background colour.  Regrettably, that's very common.  Also, plenty of other applications have hard-coded colours for other on-screen elements assuming a white window background.  It's inconsiderate, especially to visually impaired people or people like me with old eyes.  But to avoid pain with all those applications, the best I can do in practice is choose a mid-range colour - it's not fully white, but it still gives high contrast in the majority of applications which want to present information and menu text in black, dark grey, or other dark colours.  Using a mid-range colour as the background in Windows, unfortunately gives rise to the contrast problem in Pegasus.</p><p> </p><p>My suggestion is that Pegasus should do one or more of the following four things:</p><p><span style="font-size: 10pt;">1.   Use the Windows system text colour, whenever displaying text on a background which is the Windows system background colour.  This works, because normally, anyone who has changed the Windows system background colour will also have changed the text colour to something which gives them enough contrast.   This is fairly conventional and my preferred approach.</span></p><p><span style="font-size: 10pt;"></span>2.   Provide a setting for the user to choose the on-screen colour for text elements, instead of setting it programmatically.   (But I understand that adding any setting requires a lot of UI coding and redesign, and the more settings there are in the application, the more complex the application becomes for other users.)   </p><p><span style="font-size: 10pt;">3.   Provide a configuration option in PMAIL.INI which can control this behaviour and which can be edited manually by anyone who needs to.</span></p><p>4.   Use a better algorithm for picking a high contrast colour, instead of (#FFFFFF - background).   As explained in the linked article above, for a first pass, black text looks best on any background which is brighter than #808080, white text looks best on any darker background.  For a more sophisticated second pass approach, instead of setting the cut-off at #808080 (and it's going to be hard to determine if a colour like #2080A0 is brighter or darker than that), you could calculate the luminance of the background colour.</p><p>In my own work I use the following Java code [url=http://en.wikipedia.org/wiki/Relative_luminance]to calculate relative luminance[/url] from a standard Windows colour value like #FFFFFF, i.e. an integer RGB colour.  It involves several steps as you have to convert to sRGB first.  You are welcome to use this code in PMail.</p><p> </p><p><span style="white-space: pre;"> </span>public static double luminanceRelative(int c)</p><p><span style="white-space: pre;"> </span>{</p><p><span style="white-space: pre;"> </span>float rgb[] = rgbToFloatArray(c);</p><p><span style="white-space: pre;"> </span>double sRGB[] = rgbToSRGB(rgb);</p><p><span style="white-space: pre;"> </span>return luminanceSRGB(sRGB);</p><p><span style="white-space: pre;"> </span>}</p><p><span style="white-space: pre;"> </span></p><p><span style="font-size: 10pt; white-space: pre;"> </span><span style="font-size: 10pt;">private static float[] rgbToFloatArray(int c)</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>{</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>int g = c >> 8;</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>int r = g >> 8;</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>g = g & 0xff;</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>int b = c & 0xff;</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>float f[] = { r / 255F, g / 255F, b / 255F };</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>return f;</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>}</span></p><p><span style="font-size: 13.3333px;"> </span></p><p><span style="white-space: pre;"> </span>private static double[] rgbToSRGB(float[] rgb)</p><p><span style="white-space: pre;"> </span>{</p><p><span style="white-space: pre;"> </span>double sRGB[] = new double[3];</p><p><span style="white-space: pre;"> </span>int i = 0;</p><p><span style="white-space: pre;"> </span>for (float f : rgb) {</p><p><span style="white-space: pre;"> </span>if (f > 0.03928F) <span style="font-size: 10pt;">sRGB</span><span style="font-size: 10pt;">[ i ] = Math.pow((f + 0.055) / 1.055, 2.4);</span></p><p><span style="white-space: pre;"> </span>else <span style="font-size: 10pt;">sRGB</span><span style="font-size: 10pt;">[ i ] = f / 12.92;</span></p><p><span style="white-space: pre;"> </span>i++;</p><p><span style="white-space: pre;"> </span>}</p><p><span style="white-space: pre;"> </span>return <span style="font-size: 10pt;">sRGB</span><span style="font-size: 10pt;">;</span></p><p><span style="white-space: pre;"> </span>}</p><p><span style="white-space: pre;"> </span></p><p><span style="white-space: pre;"> </span>private static double luminanceSRGB(double[] sRGB)</p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>{</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>return 0.2126 * sRGB[0] + 0.7152 * </span><span style="font-size: 10pt;">sRGB[</span>1] + 0.0722 * <span style="font-size: 10pt;">sRGB</span><span style="font-size: 10pt;">[2];</span></p><p><span style="font-size: 13.3333px;"><span style="white-space:pre"> </span>}</span></p><p> </p>

I understand your point. I'm also concerned about eye strain too but treat this application by application is not the best practice IMHO. I use f.lux for this. It takes care of the problem so greatly I even forget it's running. And better: it does it for ALL applications I'm using with refinements like taking the time of the day and your geographic position in account to correct your screen color along the day work. I recommend its use to all my customers and friends.

I understand your point. I'm also concerned about eye strain too but treat this application by application is not the best practice IMHO. I use <b>f.lux</b> for this. It takes care of the problem so greatly I even forget it's running. And better: it does it for ALL applications I'm using with refinements like taking the time of the day and your geographic position in account to correct your screen color along the day work. I recommend its use to all my customers and friends.

-- Euler

Pegasus Mail 4.81.1154 Windows 7 Ultimate
IERenderer: 2.7.1.5 AttachMenu: 1.0.1.2
PMDebug: 2.5.8.34 BearHTML 4.9.9.6

I also struggle with stark white backgrounds and change as many as I can that are configurable within the app.  While researching f.lux I found references to a Night Light function on Win10 that I didn't know existed.  I now have it scheduled for work hours on my office PC (an 'always on' option would be nice).  I set the strength at 15 which I find to be just enough to take the blueness out of the white background, kind of like the difference between a warm white and a cool white light bulb. 

I also struggle with stark white backgrounds and change as many as I can that are configurable within the app.  While researching f.lux I found references to a Night Light function on Win10 that I didn't know existed.  I now have it scheduled for work hours on my office PC (an 'always on' option would be nice).  I set the strength at 15 which I find to be just enough to take the blueness out of the white background, kind of like the difference between a warm white and a cool white light bulb. 
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft