summaryrefslogtreecommitdiffstats
path: root/graphics/src/gradient
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--graphics/src/gradient.rs7
-rw-r--r--graphics/src/gradient/linear.rs5
2 files changed, 10 insertions, 2 deletions
diff --git a/graphics/src/gradient.rs b/graphics/src/gradient.rs
index 64f9e4b3..83f25238 100644
--- a/graphics/src/gradient.rs
+++ b/graphics/src/gradient.rs
@@ -9,7 +9,7 @@ use crate::{Color, Point, Size};
/// A fill which transitions colors progressively along a direction, either linearly, radially (TBD),
/// or conically (TBD).
pub enum Gradient {
- /// A linear gradient interpolates colors along a direction from its [`start`] to its [`end`]
+ /// A linear gradient interpolates colors along a direction from its `start` to its `end`
/// point.
Linear(Linear),
}
@@ -23,10 +23,15 @@ impl Gradient {
#[derive(Debug, Clone, Copy, PartialEq)]
/// A point along the gradient vector where the specified [`color`] is unmixed.
+///
+/// [`color`]: Self::color
pub struct ColorStop {
/// Offset along the gradient vector.
pub offset: f32,
+
/// The color of the gradient at the specified [`offset`].
+ ///
+ /// [`offset`]: Self::offset
pub color: Color,
}
diff --git a/graphics/src/gradient/linear.rs b/graphics/src/gradient/linear.rs
index 9928c1eb..c886db47 100644
--- a/graphics/src/gradient/linear.rs
+++ b/graphics/src/gradient/linear.rs
@@ -2,7 +2,10 @@
use crate::gradient::{ColorStop, Gradient, Position};
use crate::{Color, Point};
-/// A linear gradient that can be used in the style of [`super::Fill`] or [`super::Stroke`].
+/// A linear gradient that can be used in the style of [`Fill`] or [`Stroke`].
+///
+/// [`Fill`]: crate::widget::canvas::Fill
+/// [`Stroke`]: crate::widget::canvas::Stroke
#[derive(Debug, Clone, PartialEq)]
pub struct Linear {
/// The point where the linear gradient begins.