Add color inverting support

This commit is contained in:
Isaac Mills 2025-02-17 11:43:56 -07:00
parent a09d418a60
commit 148c4fe789
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
2 changed files with 7 additions and 3 deletions

6
Cargo.lock generated
View file

@ -1466,7 +1466,7 @@ dependencies = [
[[package]]
name = "glyphon"
version = "0.8.0"
source = "git+https://git.nations.lol/fnmain/glyphon.git#9707e9c6cf873108e2aea9b1750e7166f6cb9e2b"
source = "git+https://git.nations.lol/fnmain/glyphon.git#675f627c9c7f62e77c4063eac5ae7d2e2d4dc6cc"
dependencies = [
"cosmic-text",
"etagere",
@ -2944,9 +2944,9 @@ dependencies = [
[[package]]
name = "tempfile"
version = "3.17.0"
version = "3.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a40f762a77d2afa88c2d919489e390a12bdd261ed568e60cfa7e48d4e20f0d33"
checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230"
dependencies = [
"cfg-if",
"fastrand",

View file

@ -20,6 +20,7 @@ pub struct BufferWithTextArea<T> {
pub rect: Rect,
pub scale: f32,
pub opacity: f32,
pub invert: f32,
pub default_color: Color,
pub associated_data: T,
}
@ -57,6 +58,7 @@ impl<T> BufferWithTextArea<T> {
buffer: Arc<RwLock<Buffer>>,
rect: Rect,
opacity: f32,
invert: f32,
default_color: Color,
ctx: &egui::Context,
associated_data: T,
@ -68,6 +70,7 @@ impl<T> BufferWithTextArea<T> {
rect,
scale: ppi,
opacity,
invert,
default_color,
associated_data,
}
@ -176,6 +179,7 @@ impl<T: Sync + Send> egui_wgpu::CallbackTrait for GlyphonRendererCallback<T> {
default_color: b.default_color,
custom_glyphs: &[],
opacity: b.opacity,
invert: b.invert,
})
.collect();
glyphon_renderer