mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add a Clear gradient spread that cuts off to transparency beyond the ends (#4410)
This commit is contained in:
committed by
Dennis Kobert
parent
1d250f6d51
commit
3f70e28948
@@ -1209,7 +1209,7 @@ fn gradient_form(_: impl Ctx, gradient: Gradient, gradient_form: vector_types::G
|
||||
(gradient, Attr(gradient_form))
|
||||
}
|
||||
|
||||
/// Sets how each gradient in the input list extends past its endpoints: Pad, Reflect, or Repeat.
|
||||
/// Sets how each gradient in the input list extends past its endpoints: Pad, Reflect, Repeat, or Clear.
|
||||
#[node_macro::node(category("Gradient"))]
|
||||
fn gradient_spread(_: impl Ctx, gradient: Gradient, gradient_spread: vector_types::GradientSpread) -> (Gradient, Attr<GradientSpreadAttr>) {
|
||||
(gradient, Attr(gradient_spread))
|
||||
@@ -1237,7 +1237,7 @@ fn gradient_midpoints(_: impl Ctx, mut gradient: Gradient, midpoints: List<f64>)
|
||||
gradient
|
||||
}
|
||||
|
||||
/// Evaluates the color at the specified position along the gradient, given a position from 0 (left) to 1 (right). Positions beyond that range follow the gradient's `gradient_spread` attribute: Pad (default), Reflect, or Repeat.
|
||||
/// Evaluates the color at the specified position along the gradient, given a position from 0 (left) to 1 (right). Positions beyond that range follow the gradient's `gradient_spread` attribute: Pad (default), Reflect, Repeat, or Clear.
|
||||
#[node_macro::node(category("Color"))]
|
||||
fn sample_gradient(
|
||||
ctx: impl Ctx + ExtractIndex + InjectIndex + Copy,
|
||||
|
||||
Reference in New Issue
Block a user