mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Rename the 'Sample Gradient' node to 'Evaluate Gradient' (#4422)
* Rename the 'Sample Gradient' node to 'Evaluate Gradient' * Let the Evaluate Gradient node's position reach the out-of-range values its spread modes handle
This commit is contained in:
committed by
Dennis Kobert
parent
ed738b8e5c
commit
ca615fd6fc
@@ -1259,11 +1259,13 @@ fn gradient_midpoints(_: impl Ctx, mut gradient: Gradient, midpoints: IList<f64>
|
||||
|
||||
/// 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. Colors between stops interpolate in the gradient's `gradient_space` color space.
|
||||
#[node_macro::node(category("Color"))]
|
||||
fn sample_gradient(
|
||||
fn evaluate_gradient(
|
||||
ctx: impl Ctx + ExtractIndex + InjectIndex + Copy,
|
||||
_primary: (),
|
||||
#[default(Color::BLACK, Color::WHITE)] gradient: IList<Gradient>,
|
||||
position: Fraction,
|
||||
#[range]
|
||||
#[soft(0..1)]
|
||||
position: f64,
|
||||
) -> Result<IList<Color>, Interrupt> {
|
||||
// An unwired gradient serves an empty level: no color
|
||||
if gradient.is_empty() || ctx.index() != 0 {
|
||||
|
||||
Reference in New Issue
Block a user