mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Make the node graph use Table<GradientStops> instead of GradientStops (#3837)
* Switch from GradientStops to Table<GradientStops> in all nodes * Remove TaggedValue::ColorNotInTable * Fix bug Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Add migrations * Fix default gradient on empty table * Update demo artwork --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -16,16 +16,17 @@ async fn gradient_map<T: Adjust<Color>>(
|
||||
Table<Raster<CPU>>,
|
||||
Table<Color>,
|
||||
Table<GradientStops>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
gradient: GradientStops,
|
||||
gradient: Table<GradientStops>,
|
||||
reverse: bool,
|
||||
) -> T {
|
||||
let Some(row) = gradient.get(0) else { return image };
|
||||
|
||||
image.adjust(|color| {
|
||||
let intensity = color.luminance_srgb();
|
||||
let intensity = if reverse { 1. - intensity } else { intensity };
|
||||
gradient.evaluate(intensity as f64).to_linear_srgb()
|
||||
row.element.evaluate(intensity as f64).to_linear_srgb()
|
||||
});
|
||||
|
||||
image
|
||||
|
||||
Reference in New Issue
Block a user