hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Color Schemes on Raspbian

Tue Feb 23, 2016 7:08 am

Hi,

I am needing to remove all blue colors from my monitor, in order to work on it late at night ... Doctor's orders.
White or any color with blue in it resets seritonin, and is causing me to have a sleeping disorder.
I am an expert linux user, but I am not used to Raspian. I normally use native X11 apps or Gnustep, which obeys X11 commands. The raspberry pi does not obey X11 command switches such as -bg gold or -background gold when it comes to menus.

I did find the menu->Preferences->appearances dialog, and changed all blues into greens, whites into golds and yellows; but several widgets are still black on white. I am extremely frustrated. I can make the active application on the desktop have a green window manager bar but all inactive windows turn white. LXterminal has a seperate preferences menu that allows changing the background to green, and the foreground to black. But the File, Edit, Tabs, etc. are still black on white. The scroll bars don't change color either.

Is this a QT issue, or a window manager issue? and where is the file that holds the colors, eg: /etc/what? or /usr/shared/what? etc.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 5:25 pm

Try your TV/screens settings- theres probably a filter on there that will apply a red overlay on your screen, or an option to change the hue.
This signature intentionally left blank.

hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 5:40 pm

Thanks for the reply.

There is a Color filter. My monitor has three presets for different RGB profiles to get a true color rendering and a custom filter. I used the custom filter and turned blue all the way down to zero. The whites become slightly off white, but not yellow, orange or green. Blue text is a different shade of blue, but clearly still blue.
:!:
A bit of trivia: back in the 90's monitor companies sold Amber screen monitors for people like me, or others who are color blind. Sitting a few inches away from a CRT monitor for 8 hours a day exposes people to low level X-rays, so the new LCD monitors were supposed to be much better for a person's health. How strange that no programmers thinks about easy reading on HDMI monitors when developing GUI's... I wonder if nearly all QT developers have nearly perfect color vision.... :lol:

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 5:44 pm

Totally excluding blue is overkill and probably not what the doctor actually meant. As suggested above, look for a 'warm' monitor setting. That should be enough to tilt the colour balance to something closer resembling natural evening sunset hues.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 6:07 pm

hackernotcracker wrote:Thanks for the reply.

There is a Color filter. My monitor has three presets for different RGB profiles to get a true color rendering and a custom filter. I used the custom filter and turned blue all the way down to zero. The whites become slightly off white, but not yellow, orange or green. Blue text is a different shade of blue, but clearly still blue.
:!:
A bit of trivia: back in the 90's monitor companies sold Amber screen monitors for people like me, or others who are color blind. Sitting a few inches away from a CRT monitor for 8 hours a day exposes people to low level X-rays, so the new LCD monitors were supposed to be much better for a person's health. How strange that no programmers thinks about easy reading on HDMI monitors when developing GUI's... I wonder if nearly all QT developers have nearly perfect color vision.... :lol:
Use a red/yellow overlay instead of getting rid of blue. Sorta like this:
https://images.duckduckgo.com/iu/?u=htt ... er.png&f=1
This signature intentionally left blank.

User avatar
Burngate
Posts: 6478
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 6:11 pm

Modifying all the programs, scripts, etc. to remove blue sounds like rather too much work.
Modifying Linux to adjust things would probably entail less work, but lots of digging to find the right bits to modify.
The GPU HDMI code would be the best place to do it, were it not closed.

If it were an analogue RGB system, you could have chopped the blue wire. But it's not, and HDMI has them all mixed up, so cutting the blue out of the mix would require some electronics.
If your monitor were an old-fashioned CRT, there would have been a blue wire leading to the CRT neck. But it's not.
You could, perhaps, think of modifying the light source inside the monitor - incandescent lamps could be run at low power, but cold-cathode lamps won't do that.

So the blue will have to be removed after it leaves the monitor.
#23 Orange Rosco Supergel lighting filter looks like it might work, at £6 or so.
Or maybe Lee Full Orange (CTO), 20" x 24" Color Correcting Lighting Filter at $6.50 + p&p

hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 7:42 pm

GTR2Fan wrote:Totally excluding blue is overkill and probably not what the doctor actually meant. As suggested above, look for a 'warm' monitor setting. That should be enough to tilt the colour balance to something closer resembling natural evening sunset hues.
She actually said that I have to eliminate blue completely after 9:00 P.M. ; That's the time that would normally be long after sunset. I have extreme red tinted fluorescents, but I have to turn them off as some blue still gets through. I even bought blue reflective computer glasses, but it turned out to be more of a gimmick than a real help. Short of buying extremely expensive excimer laser glasses, which remove blue (99.96%), I can't do as the doctor asks.

I know this is counter-intuitive, but apparently, there is a receptor in the eye that detects even low levels of blue both at sunset as well as sunrise. The studies cited by the doctor say the issue is not a ratio of red to blue as is found in plants for flowering; nor is it the mere presence of blue. The issue is that reset is triggered only by going from no blue light into having blue light, and only after a certain number of hours of dark (no blue). Seritonin is a timer of how long blue light is absent, it does not reset just because blue light is present. The timer also typically resets slowly, over a period of three days or so. (Jet lag is the same issue)

That means I need to have approximately the same number of hours without blue as would occur if I lived outside with no artificial light. eg: 9 to10 hours of dark for around three days, before reset will be completed. When I shut off the ceiling lights and use my old amber monitor to midnight and get up at six A.M.; I do start getting the REM sleep that I need.

(however :( ) The amber monitor has a wierd/proprietary RGB connector for an old trash-80 computer and won't work with the PI. I suppose I could try and find the wiring diagram for an HDMI cable, and try to cut the pin that transmits blue ... if there is one... but that seems pretty difficult and not likely to work...

hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 7:48 pm

Use a red/yellow overlay instead of getting rid of blue. Sorta like this:
https://images.duckduckgo.com/iu/?u=htt ... er.png&f=1
That might help, it doesn't allow green?
Is that a plastic overlay, or some kind of CSS script for web browsers?

hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 8:02 pm

Burngate wrote: If it were an analogue RGB system, you could have chopped the blue wire. But it's not, and HDMI has them all mixed up, so cutting the blue out of the mix would require some electronics.
If your monitor were an old-fashioned CRT, there would have been a blue wire leading to the CRT neck. But it's not.
You could, perhaps, think of modifying the light source inside the monitor - incandescent lamps could be run at low power, but cold-cathode lamps won't do that.

So the blue will have to be removed after it leaves the monitor.
#23 Orange Rosco Supergel lighting filter looks like it might work, at £6 or so.
Or maybe Lee Full Orange (CTO), 20" x 24" Color Correcting Lighting Filter at $6.50 + p&p
Ahhh, you know what you're talking about! :)
My monitor is OLED. I bought it specifically because individual narrow band LED's can go completely black.
In addition to super high contrast, I was hoping to be able to get rid of blue.
I was eventually planning on using the PI's as X terminals to my big machine, and allowing several high school kids to use them (even late at night.... :) )

A 65 inch 4K OLED monitor is absolutely awesome, except for the blue problem. Does roscoe make one that big?

Under slackware unix (which can not run mathematica), I can modify the X11 drivers for my intel box (intel CPU, 12 core, it's overkill $$ but lots of fun), and I just add one line to AND the blue field with 0's, then recompile. That's a proprietary GPU (AMD's R900 series), strangely enough ... but the source code is actually visible if you know the proper trick, and can be fixed.

I suppose that I could also reprogram an X11 frame buffer driver to do the same thing, but that tends to make systems very sluggish...

Does the PI under Raspbian have a source code repository so that I can recompile X11? (I still want to explore Mathematica, and don't want to fight porting all the debian libraries to slackware. )

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 8:15 pm

hackernotcracker wrote:
Use a red/yellow overlay instead of getting rid of blue. Sorta like this:
https://images.duckduckgo.com/iu/?u=htt ... er.png&f=1
That might help, it doesn't allow green?
Is that a plastic overlay, or some kind of CSS script for web browsers?
It was just an example to help you understanding what to set your TV/screens settings to. Change it like a red overlay instead ov trying to eliminate blue. Thats what all the android apps for using your phone before bed do anyway- seems to work as well since it reduces the strain on my eyes.
This signature intentionally left blank.

hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Re: Color Schemes on Raspbian

Tue Feb 23, 2016 11:03 pm

I see.

Well, I'm getting close to figuring out how to do it properly; as my monitor will not cooperate.

I think QT is used as the GUI for all the window manager and default raspberry PI applications under X11.

Qt has two ways to set colors; either a style sheet, which is like CSS for web browsers; or a default palette. Considering that the active colors in the web browser change when I set the Appearances for application, this CSS sheet is likely the culprit for my problems. I've got to figure out where it is stored.

I haven't found documentation on style sheets, but supposedly I could start a program from the command line with -style filename as an option, and a style sheet would be used to over-ride all the default colors in the program.

As to palettes; they are over ridden by style sheets; but, if a style is not used -- then the default palette is supposed to be stored in a file called either ~/.config/Trolltech.conf or /etc/xdg/Trolltech.conf.

I found the former user directory file, but it isn't global to all applications. The latter file is supposed to be a system wide default, but doesn't exist on the Pi.

Trolltech says that there is a program called "qtconfig" which lets a user customize all the colors for all applications; A soft link to the program exists on the Pi, so I can tab complete the program name: but the program itself does not exist: :cry:

root@raspberrypi: qtconfig
qtconfig: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/qtconfig': No such file or directory

I installed python qt4 bindings with "apt-get install python-qt4" to test using Qt, to see what the colors do from python. I'm thinking, perhaps the link to qtconfig comes from that archive, and it's incomplete? How would I find the correct apt-get install name to make qtconfig binaries appear?

Some people say that all recent development uses QT5, so I maybe there has to be a different version of qtconfig for QT5?

I don't know how to tell which version of QT the windows manager is using, or what program has replaced qtconfig in QT5. How can I search the raspbian archives to find out what's available to install ?

Any helpful thoughts?

hackernotcracker
Posts: 14
Joined: Tue Feb 23, 2016 6:23 am

Re: Color Schemes on Raspbian

Wed Feb 24, 2016 3:59 am

I found a files which allow changing the colours of all window manager graphics to not have blue, and I came up with a shortcut to remove blue from the themes.

eg: a one line sed script that can be run from the command line on gtk-2.0/gtkrc files, or gtk-3.0/*.css files, and the openbox-3/themerc files found in everyone's home directory under .theme/PiX. Just replace the file-name at the end of script from themerc to whatever...

sed -e 's%\(rgba[[:blank:]]*([^,]*,[^,]*,\)\([^,]*\)%\1 0%g' -e 's%white%yellow%g' -e 's%\(#[[:xdigit:]]\{4\}\)\([[:xdigit:]]\{2\}\)\([^[:xdigit:]]\)%\100\3%g' -e 's%\(#[[:xdigit:]]\{8\}\)\([[:xdigit:]]\{4\}\)%\10000%g' -i.bak themerc

Upon reboot, most of the default menu colors and backgrounds are changed in a uniform manner if this is run on all the files in .themes/PiX directory and in the .config direcotry.
There are only a few places where the colours appear to be explicitly over-ridden and need to edited by hand.

cheers.

Return to “Beginners”