Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97e1478a authored by infernix's avatar infernix
Browse files

Change nightmode to 3700K and add a new all red render effect.

The idea here is to create a more useful nightmode which uses a warmer display temperature ala f.lux and redshift.
This is easier on the eyes than simply lowering brightness and is more useful than an all red nightmode.

Change-Id: I06ffa7d91ee93656677a18bd76d751daf79d8253
parent d3453ef4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#define RENDER_EFFECT_N1_CALIBRATED_N 7
#define RENDER_EFFECT_N1_CALIBRATED_R 8
#define RENDER_EFFECT_N1_CALIBRATED_C 9
#define RENDER_EFFECT_RED 10

namespace android {

@@ -415,7 +416,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
        const GGLfixed alpha = (s.alpha << 16)/255;
        switch (renderEffect) {
            case RENDER_EFFECT_NIGHT:
                glColor4x(alpha, 0, 0, alpha);
                glColor4x(alpha, alpha*0.6204, alpha*0.3018, alpha);
                break;
            case RENDER_EFFECT_TERMINAL:
                glColor4x(0, alpha, 0, alpha);
@@ -441,6 +442,9 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
            case RENDER_EFFECT_N1_CALIBRATED_C:
                glColor4x(alpha*renderColorR/1000, alpha*renderColorG/1000, alpha*(renderColorB+30)/1000, alpha);
                break;
            case RENDER_EFFECT_RED:
                glColor4x(alpha, 0, 0, alpha);
                break;
        }
        glEnable(GL_BLEND);
        glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);