Skip to content

Commit

Permalink
Use new AlphaColor::with_alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Nov 25, 2024
1 parent c04738a commit 1d8499c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/scenes/src/pico_svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion examples/scenes/src/test_scenes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1d8499c

Please sign in to comment.