Module colstodian::traits[][src]

Expand description

The traits which form the backbone of the strongly-typed Color & ColorAlpha.

Traits

A type that implements this trait represents a color’s alpha state.

An object-safe trait implemented by both Color and DynamicColor.

An object-safe trait implemented by both ColorAlpha and DynamicColorAlpha

A type that implements this trait can be converted directly to and from an appropriately sized array of u8s.

A “conversion query” for a ColorAlpha.

A “conversion query” for a Color.

A trait meant to be used as a replacement for Into in situations where you want to bound a type as being able to be converted into a specific type of color. Because of how colstodian works and how From/Into are implemented, we can’t use them directly for this purpose.

A type that implements ColorSpace represents a specific color space. See the documentation of DynamicColorSpace for more information about what a color space is.

Performs the conversion from alpha state SrcAlphaState into Self on a raw color.

Performs the raw conversion from the ColorSpace represented by SrcSpc to the ColorSpace represented by Self in three concrete steps, each of which may do some work or be a no-op.

The complement of ConvertFromAlphaRaw. Performs the conversion from alpha state Self into DstAlphaState on a raw color.

The complement of ConvertFromRaw.

A type that implements this trait provides the ability to downcast from a dynamically-typed color to a statically-typed Color. This is implemented for all types that implement AnyColor

A type that implements this trait provides the ability to downcast from a dynamically-typed color to a statically-typed ColorAlpha. This is implemented for all types that implement AnyColorAlpha

Marks a type as representing an encoded color space.

Marks a type as representing a linear color space.

Marks a type as representing a nonlinear color space.

A type that implements this trait represents a color’s State.

Marks a type as representing a color space that is not encoded and is therefore able to have many more operations performed on it.