pub struct FigureElem {
pub body: Content,
/* private fields */
}
Expand description
A figure with an optional caption.
Automatically detects its kind to select the correct counting track. For example, figures containing images will be numbered separately from figures containing tables.
§Examples
The example below shows a basic figure with an image:
@glacier shows a glacier. Glaciers
are complex systems.
#figure(
image("glacier.jpg", width: 80%),
caption: [A curious figure.],
) <glacier>
You can also insert tables into figures to give them a caption. The figure will detect this and automatically use a separate counter.
#figure(
table(
columns: 4,
[t], [1], [2], [3],
[y], [0.3s], [0.4s], [0.8s],
),
caption: [Timing results],
)
This behaviour can be overridden by explicitly specifying the figure’s
kind
. All figures of the same kind share a common counter.
§Figure behaviour
By default, figures are placed within the flow of content. To make them
float to the top or bottom of the page, you can use the
placement
argument.
If your figure is too large and its contents are breakable across pages (e.g. if it contains a large table), then you can make the figure itself breakable across pages as well with this show rule:
#show figure: set block(breakable: true)
See the block documentation for more information about breakable and non-breakable blocks.
§Caption customization
You can modify the appearance of the figure’s caption with its associated
caption
function. In the example below, we emphasize
all captions:
#show figure.caption: emph
#figure(
rect[Hello],
caption: [I am emphasized!],
)
By using a where
selector, we can scope such rules to
specific kinds of figures. For example, to position the caption above
tables, but keep it below for all other kinds of figures, we could write the
following show-set rule:
#show figure.where(
kind: table
): set figure.caption(position: top)
#figure(
table(columns: 2)[A][B][C][D],
caption: [I'm up here],
)
Fields§
§body: Content
Implementations§
Source§impl FigureElem
impl FigureElem
Sourcepub fn new(body: Content) -> FigureElem
pub fn new(body: Content) -> FigureElem
Create a new instance of the element.
Sourcepub fn with_placement(self, placement: Option<Smart<VAlignment>>) -> FigureElem
pub fn with_placement(self, placement: Option<Smart<VAlignment>>) -> FigureElem
Builder-style setter for the placement
field.
Sourcepub fn with_scope(self, scope: PlacementScope) -> FigureElem
pub fn with_scope(self, scope: PlacementScope) -> FigureElem
Builder-style setter for the scope
field.
Sourcepub fn with_caption(self, caption: Option<Packed<FigureCaption>>) -> FigureElem
pub fn with_caption(self, caption: Option<Packed<FigureCaption>>) -> FigureElem
Builder-style setter for the caption
field.
Sourcepub fn with_kind(self, kind: Smart<FigureKind>) -> FigureElem
pub fn with_kind(self, kind: Smart<FigureKind>) -> FigureElem
Builder-style setter for the kind
field.
Sourcepub fn with_supplement(
self,
supplement: Smart<Option<Supplement>>,
) -> FigureElem
pub fn with_supplement( self, supplement: Smart<Option<Supplement>>, ) -> FigureElem
Builder-style setter for the supplement
field.
Sourcepub fn with_numbering(self, numbering: Option<Numbering>) -> FigureElem
pub fn with_numbering(self, numbering: Option<Numbering>) -> FigureElem
Builder-style setter for the numbering
field.
Sourcepub fn with_gap(self, gap: Length) -> FigureElem
pub fn with_gap(self, gap: Length) -> FigureElem
Builder-style setter for the gap
field.
Sourcepub fn with_outlined(self, outlined: bool) -> FigureElem
pub fn with_outlined(self, outlined: bool) -> FigureElem
Builder-style setter for the outlined
field.
Sourcepub fn with_counter(self, counter: Option<Counter>) -> FigureElem
pub fn with_counter(self, counter: Option<Counter>) -> FigureElem
Builder-style setter for the counter
field.
Sourcepub fn push_placement(&mut self, placement: Option<Smart<VAlignment>>)
pub fn push_placement(&mut self, placement: Option<Smart<VAlignment>>)
Setter for the placement
field.
Sourcepub fn push_scope(&mut self, scope: PlacementScope)
pub fn push_scope(&mut self, scope: PlacementScope)
Setter for the scope
field.
Sourcepub fn push_caption(&mut self, caption: Option<Packed<FigureCaption>>)
pub fn push_caption(&mut self, caption: Option<Packed<FigureCaption>>)
Setter for the caption
field.
Sourcepub fn push_kind(&mut self, kind: Smart<FigureKind>)
pub fn push_kind(&mut self, kind: Smart<FigureKind>)
Setter for the kind
field.
Sourcepub fn push_supplement(&mut self, supplement: Smart<Option<Supplement>>)
pub fn push_supplement(&mut self, supplement: Smart<Option<Supplement>>)
Setter for the supplement
field.
Sourcepub fn push_numbering(&mut self, numbering: Option<Numbering>)
pub fn push_numbering(&mut self, numbering: Option<Numbering>)
Setter for the numbering
field.
Sourcepub fn push_outlined(&mut self, outlined: bool)
pub fn push_outlined(&mut self, outlined: bool)
Setter for the outlined
field.
Sourcepub fn push_counter(&mut self, counter: Option<Counter>)
pub fn push_counter(&mut self, counter: Option<Counter>)
Setter for the counter
field.
Sourcepub fn placement(&self, styles: StyleChain<'_>) -> Option<Smart<VAlignment>>
pub fn placement(&self, styles: StyleChain<'_>) -> Option<Smart<VAlignment>>
The figure’s placement on the page.
{none}
: The figure stays in-flow exactly where it was specified like other content.{auto}
: The figure picks{top}
or{bottom}
depending on which is closer.{top}
: The figure floats to the top of the page.{bottom}
: The figure floats to the bottom of the page.
The gap between the main flow content and the floating figure is
controlled by the clearance
argument on the
place
function.
#set page(height: 200pt)
= Introduction
#figure(
placement: bottom,
caption: [A glacier],
image("glacier.jpg", width: 60%),
)
#lorem(60)
Sourcepub fn scope(&self, styles: StyleChain<'_>) -> PlacementScope
pub fn scope(&self, styles: StyleChain<'_>) -> PlacementScope
Relative to which containing scope the figure is placed.
Set this to {"parent"}
to create a full-width figure in a two-column
document.
Has no effect if placement
is {none}
.
#set page(height: 250pt, columns: 2)
= Introduction
#figure(
placement: bottom,
scope: "parent",
caption: [A glacier],
image("glacier.jpg", width: 60%),
)
#lorem(60)
Sourcepub fn caption<'a>(
&'a self,
styles: StyleChain<'a>,
) -> &'a Option<Packed<FigureCaption>>
pub fn caption<'a>( &'a self, styles: StyleChain<'a>, ) -> &'a Option<Packed<FigureCaption>>
The figure’s caption.
Sourcepub fn kind(&self, styles: StyleChain<'_>) -> Smart<FigureKind>
pub fn kind(&self, styles: StyleChain<'_>) -> Smart<FigureKind>
The kind of figure this is.
All figures of the same kind share a common counter.
If set to {auto}
, the figure will try to automatically determine its
kind based on the type of its body. Automatically detected kinds are
tables and code. In other cases, the inferred kind is
that of an image.
Setting this to something other than {auto}
will override the
automatic detection. This can be useful if
- you wish to create a custom figure type that is not an image, a [table] or code,
- you want to force the figure to use a specific counter regardless of its content.
You can set the kind to be an element function or a string. If you set
it to an element function other than {table}
, {raw}
or {image}
, you will need to manually specify the figure’s
supplement.
#figure(
circle(radius: 10pt),
caption: [A curious atom.],
kind: "atom",
supplement: [Atom],
)
Sourcepub fn supplement<'a>(
&'a self,
styles: StyleChain<'a>,
) -> &'a Smart<Option<Supplement>>
pub fn supplement<'a>( &'a self, styles: StyleChain<'a>, ) -> &'a Smart<Option<Supplement>>
The figure’s supplement.
If set to {auto}
, the figure will try to automatically determine the
correct supplement based on the kind
and the active
text language. If you are using a custom figure type, you
will need to manually specify the supplement.
If a function is specified, it is passed the first descendant of the
specified kind
(typically, the figure’s body) and should return
content.
#figure(
[The contents of my figure!],
caption: [My custom figure],
supplement: [Bar],
kind: "foo",
)
Sourcepub fn numbering<'a>(&'a self, styles: StyleChain<'a>) -> &'a Option<Numbering>
pub fn numbering<'a>(&'a self, styles: StyleChain<'a>) -> &'a Option<Numbering>
How to number the figure. Accepts a numbering pattern or function.
Sourcepub fn gap(&self, styles: StyleChain<'_>) -> Length
pub fn gap(&self, styles: StyleChain<'_>) -> Length
The vertical gap between the body and caption.
Sourcepub fn outlined(&self, styles: StyleChain<'_>) -> bool
pub fn outlined(&self, styles: StyleChain<'_>) -> bool
Whether the figure should appear in an [outline
] of figures.
Sourcepub fn counter(&self) -> Option<&Option<Counter>>
pub fn counter(&self) -> Option<&Option<Counter>>
Convenience field to get access to the counter for this figure.
The counter only depends on the kind
:
- For (tables)[@table]:
{counter(figure.where(kind: table))}
- For (images)[@image]:
{counter(figure.where(kind: image))}
- For a custom kind:
{counter(figure.where(kind: kind))}
These are the counters you’ll need to modify if you want to skip a number or reset the counter.
Sourcepub fn placement_in(styles: StyleChain<'_>) -> Option<Smart<VAlignment>>
pub fn placement_in(styles: StyleChain<'_>) -> Option<Smart<VAlignment>>
Access the placement
field in the given style chain.
Sourcepub fn scope_in(styles: StyleChain<'_>) -> PlacementScope
pub fn scope_in(styles: StyleChain<'_>) -> PlacementScope
Access the scope
field in the given style chain.
Sourcepub fn caption_in(styles: StyleChain<'_>) -> &Option<Packed<FigureCaption>>
pub fn caption_in(styles: StyleChain<'_>) -> &Option<Packed<FigureCaption>>
Access the caption
field in the given style chain.
Sourcepub fn kind_in(styles: StyleChain<'_>) -> Smart<FigureKind>
pub fn kind_in(styles: StyleChain<'_>) -> Smart<FigureKind>
Access the kind
field in the given style chain.
Sourcepub fn supplement_in(styles: StyleChain<'_>) -> &Smart<Option<Supplement>>
pub fn supplement_in(styles: StyleChain<'_>) -> &Smart<Option<Supplement>>
Access the supplement
field in the given style chain.
Sourcepub fn numbering_in(styles: StyleChain<'_>) -> &Option<Numbering>
pub fn numbering_in(styles: StyleChain<'_>) -> &Option<Numbering>
Access the numbering
field in the given style chain.
Sourcepub fn gap_in(styles: StyleChain<'_>) -> Length
pub fn gap_in(styles: StyleChain<'_>) -> Length
Access the gap
field in the given style chain.
Sourcepub fn outlined_in(styles: StyleChain<'_>) -> bool
pub fn outlined_in(styles: StyleChain<'_>) -> bool
Access the outlined
field in the given style chain.
Sourcepub fn set_placement(placement: Option<Smart<VAlignment>>) -> Property
pub fn set_placement(placement: Option<Smart<VAlignment>>) -> Property
Create a style property for the placement
field.
Sourcepub fn set_scope(scope: PlacementScope) -> Property
pub fn set_scope(scope: PlacementScope) -> Property
Create a style property for the scope
field.
Sourcepub fn set_caption(caption: Option<Packed<FigureCaption>>) -> Property
pub fn set_caption(caption: Option<Packed<FigureCaption>>) -> Property
Create a style property for the caption
field.
Sourcepub fn set_kind(kind: Smart<FigureKind>) -> Property
pub fn set_kind(kind: Smart<FigureKind>) -> Property
Create a style property for the kind
field.
Sourcepub fn set_supplement(supplement: Smart<Option<Supplement>>) -> Property
pub fn set_supplement(supplement: Smart<Option<Supplement>>) -> Property
Create a style property for the supplement
field.
Sourcepub fn set_numbering(numbering: Option<Numbering>) -> Property
pub fn set_numbering(numbering: Option<Numbering>) -> Property
Create a style property for the numbering
field.
Sourcepub fn set_outlined(outlined: bool) -> Property
pub fn set_outlined(outlined: bool) -> Property
Create a style property for the outlined
field.
Trait Implementations§
Source§impl Capable for FigureElem
impl Capable for FigureElem
Source§impl Clone for FigureElem
impl Clone for FigureElem
Source§fn clone(&self) -> FigureElem
fn clone(&self) -> FigureElem
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Construct for FigureElem
impl Construct for FigureElem
Source§impl Debug for FigureElem
impl Debug for FigureElem
Source§impl Fields for FigureElem
impl Fields for FigureElem
Source§fn field(&self, id: u8) -> Result<Value, FieldAccessError>
fn field(&self, id: u8) -> Result<Value, FieldAccessError>
Source§fn field_with_styles(
&self,
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>
fn field_with_styles( &self, id: u8, styles: StyleChain<'_>, ) -> Result<Value, FieldAccessError>
Source§fn field_from_styles(
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>
fn field_from_styles( id: u8, styles: StyleChain<'_>, ) -> Result<Value, FieldAccessError>
Source§fn materialize(&mut self, styles: StyleChain<'_>)
fn materialize(&mut self, styles: StyleChain<'_>)
Source§impl Hash for FigureElem
impl Hash for FigureElem
Source§impl IntoValue for FigureElem
impl IntoValue for FigureElem
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Source§impl NativeElement for FigureElem
impl NativeElement for FigureElem
Source§impl NativeScope for FigureElem
impl NativeScope for FigureElem
Source§fn constructor() -> Option<&'static NativeFuncData>
fn constructor() -> Option<&'static NativeFuncData>
Source§impl PartialEq for FigureElem
impl PartialEq for FigureElem
Source§impl Repr for FigureElem
impl Repr for FigureElem
Auto Trait Implementations§
impl Freeze for FigureElem
impl !RefUnwindSafe for FigureElem
impl Send for FigureElem
impl Sync for FigureElem
impl Unpin for FigureElem
impl !UnwindSafe for FigureElem
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult for Twhere
T: IntoValue,
impl<T> IntoResult for Twhere
T: IntoValue,
Source§fn into_result(self, _: Span) -> Result<Value, EcoVec<SourceDiagnostic>>
fn into_result(self, _: Span) -> Result<Value, EcoVec<SourceDiagnostic>>
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more