summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2019-06-03 15:00:50 +0200
committerBenjamin Berg <benjamin@sipsolutions.net>2019-07-30 08:37:12 +0000
commit62981b3c18baa1e34060062c3ae8f1c1b3064691 (patch)
tree5b5cb4ca486c024b73f6864311ab8464ba90d4ff
parent37cc9af6d2e54ed7797fc178e16e294b59dfc10a (diff)
downloadgnome-settings-daemon-62981b3c18baa1e34060062c3ae8f1c1b3064691.tar.gz
color: Switch to better black body color calculation
The planckian calculation is much better, but it also means we need to change the default from 4000K to 2700K to get a similar effect. 2700K is actually a good value as it is similar to commonly found "warm-white" artificial lights. Note that the defaults and range in g-c-c will also need to be adjusted for this change.
-rw-r--r--data/org.gnome.settings-daemon.plugins.color.gschema.xml.in2
-rw-r--r--plugins/color/gsd-color-state.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in b/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in
index cb24e3c2..286ea808 100644
--- a/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in
+++ b/data/org.gnome.settings-daemon.plugins.color.gschema.xml.in
@@ -17,7 +17,7 @@
<description>Night light mode changes the color temperature of your display when the sun has gone down or at preset times.</description>
</key>
<key name="night-light-temperature" type="u">
- <default>4000</default>
+ <default>2700</default>
<summary>Temperature of the display when enabled</summary>
<description>This temperature in Kelvin is used to modify the screen tones when night light mode is enabled. Higher values are bluer, lower redder.</description>
</key>
diff --git a/plugins/color/gsd-color-state.c b/plugins/color/gsd-color-state.c
index b4bf1807..26a277a1 100644
--- a/plugins/color/gsd-color-state.c
+++ b/plugins/color/gsd-color-state.c
@@ -411,7 +411,7 @@ gcm_session_generate_vcgt (CdProfile *profile, guint color_temperature, guint si
/* get the color temperature */
if (!cd_color_get_blackbody_rgb_full (color_temperature,
&temp,
- CD_COLOR_BLACKBODY_FLAG_NONE)) {
+ CD_COLOR_BLACKBODY_FLAG_USE_PLANCKIAN)) {
g_warning ("failed to get blackbody for %uK", color_temperature);
cd_color_rgb_set (&temp, 1.0, 1.0, 1.0);
} else {
@@ -564,7 +564,7 @@ gcm_session_device_reset_gamma (GnomeRROutput *output,
/* get the color temperature */
if (!cd_color_get_blackbody_rgb_full (color_temperature,
&temp,
- CD_COLOR_BLACKBODY_FLAG_NONE)) {
+ CD_COLOR_BLACKBODY_FLAG_USE_PLANCKIAN)) {
g_warning ("failed to get blackbody for %uK", color_temperature);
cd_color_rgb_set (&temp, 1.0, 1.0, 1.0);
} else {