1
0
Fork 0
forked from wry/wry

theme: store colors in linear space

This commit is contained in:
Julian Orth 2025-02-25 15:43:05 +01:00
parent b7f93b37a6
commit 135f37dbcd
27 changed files with 221 additions and 135 deletions

View file

@ -18,7 +18,7 @@ use {
sys::{GL_ONE, GL_ONE_MINUS_SRC_ALPHA},
},
rect::Region,
theme::Color,
theme::{Color, TransferFunction},
},
std::{
cell::Cell,
@ -78,7 +78,8 @@ impl Framebuffer {
(gles.glBindFramebuffer)(GL_FRAMEBUFFER, self.gl.fbo);
(gles.glViewport)(0, 0, self.gl.width, self.gl.height);
if let Some(c) = clear {
(gles.glClearColor)(c.r, c.g, c.b, c.a);
let [r, g, b, a] = c.to_array(TransferFunction::Srgb);
(gles.glClearColor)(r, g, b, a);
(gles.glClear)(GL_COLOR_BUFFER_BIT);
}
(gles.glBlendFunc)(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);