Skip to content

Commit 7b8272e

Browse files
committed
Convert documentation to intra doc links
1 parent 1b5d639 commit 7b8272e

File tree

15 files changed

+68
-68
lines changed

15 files changed

+68
-68
lines changed

palette/src/alpha/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod alpha;
1313
/// channel of a color type. The color type itself doesn't need to store the
1414
/// transparency value as it can be transformed into or wrapped in a type that
1515
/// has a representation of transparency. This would typically be done by
16-
/// wrapping it in an [`Alpha`](struct.Alpha.html) instance.
16+
/// wrapping it in an [`Alpha`](crate::Alpha) instance.
1717
///
1818
/// # Deriving
1919
/// The trait is trivial enough to be automatically derived. If the color type

palette/src/blend/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Palette offers both OpenGL style blending equations, as well as most of the
44
//! SVG composition operators (also common in photo manipulation software). The
55
//! composition operators are all implemented in the
6-
//! [`Blend`](trait.Blend.html) trait, and ready to use with any appropriate
6+
//! [`Blend`](crate::Blend) trait, and ready to use with any appropriate
77
//! color type:
88
//!
99
//! ```
@@ -15,7 +15,7 @@
1515
//! ```
1616
//!
1717
//! Blending equations can be defined using the
18-
//! [`Equations`](struct.Equations.html) type, which is then passed to the
18+
//! [`Equations`](crate::blend::Equations) type, which is then passed to the
1919
//! `blend` function, from the `Blend` trait:
2020
//!
2121
//! ```
@@ -32,7 +32,7 @@
3232
//! let c = a.blend(b, blend_mode);
3333
//! ```
3434
//!
35-
//! Note that blending will use [premultiplied alpha](struct.PreAlpha.html),
35+
//! Note that blending will use [premultiplied alpha](crate::blend::PreAlpha),
3636
//! which may result in loss of some color information in some cases. One such
3737
//! case is that a completely transparent resultant color will become black.
3838

palette/src/convert.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! The default minimum requirement is to implement `FromColorUnclamped<Xyz>`, but it can
77
//! also be customized to make use of generics and have other manual implementations.
88
//!
9-
//! It is also recommended to derive or implement [`WithAlpha`](../trait.WithAlpha.html),
9+
//! It is also recommended to derive or implement [`WithAlpha`](crate::WithAlpha),
1010
//! to be able to convert between all `Alpha` wrapped color types.
1111
//!
1212
//! ## Configuration Attributes
@@ -319,7 +319,7 @@ impl<T> Display for OutOfBounds<T> {
319319
///
320320
/// `U: IntoColor<T>` is implemented for every type `T: FromColor<U>`.
321321
///
322-
/// See [`FromColor`](trait.FromColor.html) for more details.
322+
/// See [`FromColor`](crate::convert::FromColor) for more details.
323323
pub trait IntoColor<T>: Sized {
324324
/// Convert into T with values clamped to the color defined bounds
325325
///
@@ -336,7 +336,7 @@ pub trait IntoColor<T>: Sized {
336336
///
337337
/// `U: IntoColorUnclamped<T>` is implemented for every type `T: FromColorUnclamped<U>`.
338338
///
339-
/// See [`FromColorUnclamped`](trait.FromColorUnclamped.html) for more details.
339+
/// See [`FromColorUnclamped`](crate::convert::FromColorUnclamped) for more details.
340340
pub trait IntoColorUnclamped<T>: Sized {
341341
/// Convert into T. The resulting color might be invalid in its color space
342342
///
@@ -354,7 +354,7 @@ pub trait IntoColorUnclamped<T>: Sized {
354354
///
355355
/// `U: TryIntoColor<T>` is implemented for every type `T: TryFromColor<U>`.
356356
///
357-
/// See [`TryFromColor`](trait.TryFromColor.html) for more details.
357+
/// See [`TryFromColor`](crate::convert::TryFromColor) for more details.
358358
pub trait TryIntoColor<T>: Sized {
359359
/// Convert into T, returning ok if the color is inside of its defined
360360
/// range, otherwise an `OutOfBounds` error is returned which contains
@@ -379,8 +379,8 @@ pub trait TryIntoColor<T>: Sized {
379379
///
380380
/// `U: FromColor<T>` is implemented for every type `U: FromColorUnclamped<T> + Limited`.
381381
///
382-
/// See [`FromColorUnclamped`](trait.FromColorUnclamped.html) for a lossless version of this trait.
383-
/// See [`TryFromColor`](trait.TryFromColor.html) for a trait that gives an error when the result
382+
/// See [`FromColorUnclamped`](crate::convert::FromColorUnclamped) for a lossless version of this trait.
383+
/// See [`TryFromColor`](crate::convert::TryFromColor) for a trait that gives an error when the result
384384
/// is out of bounds.
385385
///
386386
/// # The Difference Between FromColor and From
@@ -398,7 +398,7 @@ pub trait TryIntoColor<T>: Sized {
398398
/// traits, while `From` and `Into` would not be possible to blanket implement in the same way.
399399
/// This also reduces the work that needs to be done by macros.
400400
///
401-
/// See the [`convert`](index.html) module for how to implement `FromColorUnclamped` for
401+
/// See the [`convert`](crate::convert) module for how to implement `FromColorUnclamped` for
402402
/// custom colors.
403403
pub trait FromColor<T>: Sized {
404404
/// Convert from T with values clamped to the color defined bounds.
@@ -414,11 +414,11 @@ pub trait FromColor<T>: Sized {
414414

415415
/// A trait for unchecked conversion of one color from another.
416416
///
417-
/// See [`FromColor`](trait.FromColor.html) for a lossy version of this trait.
418-
/// See [`TryFromColor`](trait.TryFromColor.html) for a trait that gives an error when the result
417+
/// See [`FromColor`](crate::convert::FromColor) for a lossy version of this trait.
418+
/// See [`TryFromColor`](crate::convert::TryFromColor) for a trait that gives an error when the result
419419
/// is out of bounds.
420420
///
421-
/// See the [`convert`](index.html) module for how to implement `FromColorUnclamped` for
421+
/// See the [`convert`](crate::convert) module for how to implement `FromColorUnclamped` for
422422
/// custom colors.
423423
pub trait FromColorUnclamped<T>: Sized {
424424
/// Convert from T. The resulting color might be invalid in its color space.
@@ -437,10 +437,10 @@ pub trait FromColorUnclamped<T>: Sized {
437437
///
438438
/// `U: TryFromColor<T>` is implemented for every type `U: FromColorUnclamped<T> + Limited`.
439439
///
440-
/// See [`FromColor`](trait.FromColor.html) for a lossy version of this trait.
441-
/// See [`FromColorUnclamped`](trait.FromColorUnclamped.html) for a lossless version.
440+
/// See [`FromColor`](crate::convert::FromColor) for a lossy version of this trait.
441+
/// See [`FromColorUnclamped`](crate::convert::FromColorUnclamped) for a lossless version.
442442
///
443-
/// See the [`convert`](index.html) module for how to implement `FromColorUnclamped` for
443+
/// See the [`convert`](crate::convert) module for how to implement `FromColorUnclamped` for
444444
/// custom colors.
445445
pub trait TryFromColor<T>: Sized {
446446
/// Convert from T, returning ok if the color is inside of its defined

palette/src/hsl.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ use crate::{
2121
};
2222

2323
/// Linear HSL with an alpha component. See the [`Hsla` implementation in
24-
/// `Alpha`](struct.Alpha.html#Hsla).
24+
/// `Alpha`](crate::Alpha#Hsla).
2525
pub type Hsla<S = Srgb, T = f32> = Alpha<Hsl<S, T>, T>;
2626

2727
/// HSL color space.
2828
///
2929
/// The HSL color space can be seen as a cylindrical version of
30-
/// [RGB](rgb/struct.Rgb.html), where the `hue` is the angle around the color
30+
/// [RGB](crate::rgb::Rgb), where the `hue` is the angle around the color
3131
/// cylinder, the `saturation` is the distance from the center, and the
3232
/// `lightness` is the height from the bottom. Its composition makes it
3333
/// especially good for operations like changing green to red, making a color
3434
/// more gray, or making it darker.
3535
///
36-
/// See [HSV](struct.Hsv.html) for a very similar color space, with brightness
36+
/// See [HSV](crate::Hsv) for a very similar color space, with brightness
3737
/// instead of lightness.
3838
#[derive(Debug, PartialEq, Pixel, FromColorUnclamped, WithAlpha)]
3939
#[cfg_attr(feature = "serializing", derive(Serialize, Deserialize))]
@@ -158,7 +158,7 @@ where
158158
}
159159
}
160160

161-
///<span id="Hsla"></span>[`Hsla`](type.Hsla.html) implementations.
161+
///<span id="Hsla"></span>[`Hsla`](crate::Hsla) implementations.
162162
impl<T, A> Alpha<Hsl<Srgb, T>, A>
163163
where
164164
T: FloatComponent,
@@ -173,7 +173,7 @@ where
173173
}
174174
}
175175

176-
///<span id="Hsla"></span>[`Hsla`](type.Hsla.html) implementations.
176+
///<span id="Hsla"></span>[`Hsla`](crate::Hsla) implementations.
177177
impl<S, T, A> Alpha<Hsl<S, T>, A>
178178
where
179179
T: FloatComponent,

palette/src/hsv.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ use crate::{
2121
};
2222

2323
/// Linear HSV with an alpha component. See the [`Hsva` implementation in
24-
/// `Alpha`](struct.Alpha.html#Hsva).
24+
/// `Alpha`](crate::Alpha#Hsva).
2525
pub type Hsva<S = Srgb, T = f32> = Alpha<Hsv<S, T>, T>;
2626

2727
/// HSV color space.
2828
///
29-
/// HSV is a cylindrical version of [RGB](rgb/struct.Rgb.html) and it's very
30-
/// similar to [HSL](struct.Hsl.html). The difference is that the `value`
29+
/// HSV is a cylindrical version of [RGB](crate::rgb::Rgb) and it's very
30+
/// similar to [HSL](crate::Hsl). The difference is that the `value`
3131
/// component in HSV determines the _brightness_ of the color, and not the
3232
/// _lightness_. The difference is that, for example, red (100% R, 0% G, 0% B)
3333
/// and white (100% R, 100% G, 100% B) has the same brightness (or value), but
@@ -155,7 +155,7 @@ where
155155
}
156156
}
157157

158-
///<span id="Hsva"></span>[`Hsva`](type.Hsva.html) implementations.
158+
///<span id="Hsva"></span>[`Hsva`](crate::Hsva) implementations.
159159
impl<T, A> Alpha<Hsv<Srgb, T>, A>
160160
where
161161
T: FloatComponent,
@@ -170,7 +170,7 @@ where
170170
}
171171
}
172172

173-
///<span id="Hsva"></span>[`Hsva`](type.Hsva.html) implementations.
173+
///<span id="Hsva"></span>[`Hsva`](crate::Hsva) implementations.
174174
impl<S, T, A> Alpha<Hsv<S, T>, A>
175175
where
176176
T: FloatComponent,

palette/src/hwb.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ use crate::{
2121
};
2222

2323
/// Linear HWB with an alpha component. See the [`Hwba` implementation in
24-
/// `Alpha`](struct.Alpha.html#Hwba).
24+
/// `Alpha`](crate::Alpha#Hwba).
2525
pub type Hwba<S = Srgb, T = f32> = Alpha<Hwb<S, T>, T>;
2626

2727
/// HWB color space.
2828
///
29-
/// HWB is a cylindrical version of [RGB](rgb/struct.Rgb.html) and it's very
30-
/// closely related to [HSV](struct.Hsv.html). It describes colors with a
29+
/// HWB is a cylindrical version of [RGB](crate::rgb::Rgb) and it's very
30+
/// closely related to [HSV](crate::Hsv). It describes colors with a
3131
/// starting hue, then a degree of whiteness and blackness to mix into that
3232
/// base hue.
3333
///
@@ -161,7 +161,7 @@ where
161161
}
162162
}
163163

164-
///<span id="Hwba"></span>[`Hwba`](type.Hwba.html) implementations.
164+
///<span id="Hwba"></span>[`Hwba`](crate::Hwba) implementations.
165165
impl<T, A> Alpha<Hwb<Srgb, T>, A>
166166
where
167167
T: FloatComponent,
@@ -176,7 +176,7 @@ where
176176
}
177177
}
178178

179-
///<span id="Hwba"></span>[`Hwba`](type.Hwba.html) implementations.
179+
///<span id="Hwba"></span>[`Hwba`](crate::Hwba) implementations.
180180
impl<S, T, A> Alpha<Hwb<S, T>, A>
181181
where
182182
T: FloatComponent,

palette/src/lab.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{
1919
};
2020

2121
/// CIE L\*a\*b\* (CIELAB) with an alpha component. See the [`Laba`
22-
/// implementation in `Alpha`](struct.Alpha.html#Laba).
22+
/// implementation in `Alpha`](crate::Alpha#Laba).
2323
pub type Laba<Wp, T = f32> = Alpha<Lab<Wp, T>, T>;
2424

2525
/// The CIE L\*a\*b\* (CIELAB) color space.
@@ -152,7 +152,7 @@ where
152152
}
153153
}
154154

155-
///<span id="Laba"></span>[`Laba`](type.Laba.html) implementations.
155+
///<span id="Laba"></span>[`Laba`](crate::Laba) implementations.
156156
impl<T, A> Alpha<Lab<D65, T>, A>
157157
where
158158
T: FloatComponent,
@@ -167,7 +167,7 @@ where
167167
}
168168
}
169169

170-
///<span id="Laba"></span>[`Laba`](type.Laba.html) implementations.
170+
///<span id="Laba"></span>[`Laba`](crate::Laba) implementations.
171171
impl<Wp, T, A> Alpha<Lab<Wp, T>, A>
172172
where
173173
T: FloatComponent,

palette/src/lch.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ use crate::{
1919
};
2020

2121
/// CIE L\*C\*h° with an alpha component. See the [`Lcha` implementation in
22-
/// `Alpha`](struct.Alpha.html#Lcha).
22+
/// `Alpha`](crate::Alpha#Lcha).
2323
pub type Lcha<Wp, T = f32> = Alpha<Lch<Wp, T>, T>;
2424

25-
/// CIE L\*C\*h°, a polar version of [CIE L\*a\*b\*](struct.Lab.html).
25+
/// CIE L\*C\*h°, a polar version of [CIE L\*a\*b\*](crate::Lab).
2626
///
2727
/// L\*C\*h° shares its range and perceptual uniformity with L\*a\*b\*, but
28-
/// it's a cylindrical color space, like [HSL](struct.Hsl.html) and
29-
/// [HSV](struct.Hsv.html). This gives it the same ability to directly change
28+
/// it's a cylindrical color space, like [HSL](crate::Hsl) and
29+
/// [HSV](crate::Hsv). This gives it the same ability to directly change
3030
/// the hue and colorfulness of a color, while preserving other visual aspects.
3131
#[derive(Debug, PartialEq, Pixel, FromColorUnclamped, WithAlpha)]
3232
#[cfg_attr(feature = "serializing", derive(Serialize, Deserialize))]
@@ -151,7 +151,7 @@ where
151151
}
152152
}
153153

154-
///<span id="Lcha"></span>[`Lcha`](type.Lcha.html) implementations.
154+
///<span id="Lcha"></span>[`Lcha`](crate::Lcha) implementations.
155155
impl<T, A> Alpha<Lch<D65, T>, A>
156156
where
157157
T: FloatComponent,
@@ -166,7 +166,7 @@ where
166166
}
167167
}
168168

169-
///<span id="Lcha"></span>[`Lcha`](type.Lcha.html) implementations.
169+
///<span id="Lcha"></span>[`Lcha`](crate::Lcha) implementations.
170170
impl<Wp, T, A> Alpha<Lch<Wp, T>, A>
171171
where
172172
T: FloatComponent,

palette/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! to perform on colors (addition, subtraction, multiplication, linear interpolation,
1414
//! etc.) will work unexpectedly when performed in such a non-linear color space. As
1515
//! such, the compression has to be reverted to restore linearity and make sure that
16-
//! many operations on the colors are accurate.
16+
//! many operations on the colors are accurate.
1717
//!
1818
//! For example, this does not work:
1919
//!
@@ -96,7 +96,7 @@
9696
//! also many cases where it becomes a dead weight, if it's always stored
9797
//! together with the color, but not used. Palette has therefore adopted a
9898
//! structure where the transparency component (alpha) is attachable using the
99-
//! [`Alpha`](struct.Alpha.html) type, instead of having copies of each color
99+
//! [`Alpha`](crate::Alpha) type, instead of having copies of each color
100100
//! space.
101101
//!
102102
//! This approach comes with the extra benefit of allowing operations to
@@ -184,7 +184,7 @@
184184
//! # Working with Raw Data
185185
//!
186186
//! Oftentimes, pixel data is stored in a raw buffer such as a `[u8; 3]`. The
187-
//! [`Pixel`](encoding/pixel/trait.Pixel.html) trait allows for easy interoperation between
187+
//! [`Pixel`](crate::encoding::pixel::Pixel) trait allows for easy interoperation between
188188
//! Palette colors and other crates or systems. `from_raw` can be used to
189189
//! convert into a Palette color, `into_format` converts from `Srgb<u8>` to
190190
//! `Srgb<f32>`, and finally `into_raw` to convert from a Palette color back to

palette/src/luma/luma.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ use crate::{
2323
};
2424

2525
/// Luminance with an alpha component. See the [`Lumaa` implementation
26-
/// in `Alpha`](struct.Alpha.html#Lumaa).
26+
/// in `Alpha`](crate::Alpha#Lumaa).
2727
pub type Lumaa<S = Srgb, T = f32> = Alpha<Luma<S, T>, T>;
2828

2929
/// Luminance.
3030
///
3131
/// Luma is a purely gray scale color space, which is included more for
3232
/// completeness than anything else, and represents how bright a color is
3333
/// perceived to be. It's basically the `Y` component of [CIE
34-
/// XYZ](struct.Xyz.html). The lack of any form of hue representation limits
34+
/// XYZ](crate::Xyz). The lack of any form of hue representation limits
3535
/// the set of operations that can be performed on it.
3636
#[derive(Debug, PartialEq, Pixel, FromColorUnclamped, WithAlpha)]
3737
#[cfg_attr(feature = "serializing", derive(Serialize, Deserialize))]
@@ -166,7 +166,7 @@ where
166166
}
167167
}
168168

169-
///<span id="Lumaa"></span>[`Lumaa`](type.Lumaa.html) implementations.
169+
///<span id="Lumaa"></span>[`Lumaa`](crate::luma::Lumaa) implementations.
170170
impl<S, T, A> Alpha<Luma<S, T>, A>
171171
where
172172
T: Component,
@@ -212,7 +212,7 @@ where
212212
}
213213
}
214214

215-
///<span id="Lumaa"></span>[`Lumaa`](type.Lumaa.html) implementations.
215+
///<span id="Lumaa"></span>[`Lumaa`](crate::luma::Lumaa) implementations.
216216
impl<S, T, A> Alpha<Luma<S, T>, A>
217217
where
218218
T: FloatComponent,

0 commit comments

Comments
 (0)