Adjusted gradient transform function to be more readable.

This commit is contained in:
shan 2022-10-07 16:55:55 -07:00
parent a4a1262fa2
commit fd5e1e5ab0
4 changed files with 25 additions and 28 deletions

View file

@ -2,7 +2,7 @@
mod linear;
pub use crate::gradient::linear::{Linear, Location, Position};
use crate::{Color, Point};
use crate::Color;
#[derive(Debug, Clone, PartialEq)]
/// A fill which transitions colors progressively along a direction, either linearly, radially (TBD),
@ -27,10 +27,4 @@ impl Gradient {
pub fn linear(position: impl Into<Position>) -> linear::Builder {
linear::Builder::new(position.into())
}
pub(crate) fn coords(&mut self) -> (&mut Point, &mut Point) {
match self {
Gradient::Linear(gradient) => (&mut gradient.start, &mut gradient.end)
}
}
}