I am somewhat new to Rust, so lots of possible mistakes in here.
Anyway, this PR adds a command to add a gradient to the palette using:
p/gradient <color_start> <color _end> <steps>
which creates steps colors in the palette starting with color_start ending with color_end.
Question is : it currently adds all color, whether it is already present in palette or not. Should it ? p/add does not, but it adds a single color. I cannot really decide on this one.
It misses test, I just have no time to learn how to test in rust.
I noticed that similar function tend to be in session.rs. I put my logic in palette.rs as it is palette manipulation, I find it more legible, but it may not be the right way.
I am somewhat new to Rust, so lots of possible mistakes in here.
Anyway, this PR adds a command to add a gradient to the palette using:
p/gradient <color_start> <color _end> <steps>
which createssteps
colors in the palette starting withcolor_start
ending withcolor_end
.Question is : it currently adds all color, whether it is already present in palette or not. Should it ?
p/add
does not, but it adds a single color. I cannot really decide on this one.It misses test, I just have no time to learn how to test in rust. I noticed that similar function tend to be in
session.rs
. I put my logic inpalette.rs
as it is palette manipulation, I find it more legible, but it may not be the right way.