From 1d8499cfeb1ae805713c273c30a0fa7145342b6b Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 25 Nov 2024 11:33:40 +0700 Subject: [PATCH] Use new `AlphaColor::with_alpha` --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- examples/scenes/src/pico_svg.rs | 2 +- examples/scenes/src/test_scenes.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db9213b2..0946b95d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "color" version = "0.1.0" -source = "git+https://github.com/linebender/color.git?rev=1c9b06f702d063617c8eb1980a5b2a6fc3eae359#1c9b06f702d063617c8eb1980a5b2a6fc3eae359" +source = "git+https://github.com/linebender/color.git?rev=31a2022d586eb364d193d17fb967cacbdd81d146#31a2022d586eb364d193d17fb967cacbdd81d146" dependencies = [ "serde", ] @@ -1639,7 +1639,7 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "peniko" version = "0.2.0" -source = "git+https://github.com/linebender/peniko.git?rev=c65c325#c65c3256db1645a375a13ee000fdd65a21742119" +source = "git+https://github.com/linebender/peniko.git?rev=35373f0#35373f010f2db26e6beddd1b5bb35b50a637e844" dependencies = [ "color", "kurbo", diff --git a/Cargo.toml b/Cargo.toml index 1dde51b8..b101dc40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ skrifa = "0.22.3" # The version of kurbo used below should be kept in sync # with the version of kurbo used by peniko. # peniko = "0.2.0" -peniko = { version = "0.2.0", git = "https://github.com/linebender/peniko.git", rev = "c65c325" } +peniko = { version = "0.2.0", git = "https://github.com/linebender/peniko.git", rev = "35373f0" } # FIXME: This can be removed once peniko supports the schemars feature. kurbo = "0.11.1" futures-intrusive = "0.5.0" diff --git a/examples/scenes/src/pico_svg.rs b/examples/scenes/src/pico_svg.rs index c9c88bc4..84c6b3eb 100644 --- a/examples/scenes/src/pico_svg.rs +++ b/examples/scenes/src/pico_svg.rs @@ -282,7 +282,7 @@ fn modify_opacity(color: Color, attr_name: &str, node: Node) -> Color { } else { opacity.parse().unwrap_or(1.0) }; - color.map(|r, g, b, _a| [r, g, b, alpha.clamp(0., 1.)]) + color.with_alpha(alpha.clamp(0., 1.)) } else { color } diff --git a/examples/scenes/src/test_scenes.rs b/examples/scenes/src/test_scenes.rs index 6317281b..8acc3f12 100644 --- a/examples/scenes/src/test_scenes.rs +++ b/examples/scenes/src/test_scenes.rs @@ -1253,7 +1253,7 @@ mod impls { (125., 200., Color::from_rgba8(64, 192, 255, 255)), ]; for (x, y, c) in GRADIENTS { - let color2 = c.map(|r, g, b, _a| [r, g, b, 0.]); + let color2 = c.with_alpha(0.); let radial = Gradient::new_radial((*x, *y), 100.0).with_stops([*c, color2]); scene.fill(Fill::NonZero, transform, &radial, None, &rect); }