diff options
Diffstat (limited to 'src/gamma-vidmode.c')
-rw-r--r-- | src/gamma-vidmode.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gamma-vidmode.c b/src/gamma-vidmode.c index 58a552f..a25b06e 100644 --- a/src/gamma-vidmode.c +++ b/src/gamma-vidmode.c @@ -180,6 +180,14 @@ vidmode_set_temperature(vidmode_state_t *state, uint16_t *gamma_g = &gamma_ramps[1*state->ramp_size]; uint16_t *gamma_b = &gamma_ramps[2*state->ramp_size]; + /* Initialize gamma ramps to pure state */ + for (int i = 0; i < state->ramp_size; i++) { + uint16_t value = (double)i/state->ramp_size * (UINT16_MAX+1); + gamma_r[i] = value; + gamma_g[i] = value; + gamma_b[i] = value; + } + colorramp_fill(gamma_r, gamma_g, gamma_b, state->ramp_size, setting); |