Feature name colors -> palette
This commit is contained in:
parent
e926e43742
commit
7b15e4b0e2
3 changed files with 6 additions and 9 deletions
|
|
@ -25,7 +25,7 @@ tokio = ["iced_futures/tokio"]
|
||||||
# Enables `async-std` as the `executor::Default` on native platforms
|
# Enables `async-std` as the `executor::Default` on native platforms
|
||||||
async-std = ["iced_futures/async-std"]
|
async-std = ["iced_futures/async-std"]
|
||||||
# Enables advanced color conversion via `palette`
|
# Enables advanced color conversion via `palette`
|
||||||
colors = ["iced_core/colors"]
|
palette = ["iced_core/palette"]
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ description = "The essential concepts of Iced"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/hecrj/iced"
|
repository = "https://github.com/hecrj/iced"
|
||||||
|
|
||||||
[features]
|
|
||||||
colors = ["palette"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
[dependencies.palette]
|
[dependencies.palette]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#[cfg(feature = "colors")]
|
#[cfg(feature = "palette")]
|
||||||
use palette::rgb::Srgba;
|
use palette::rgb::Srgba;
|
||||||
|
|
||||||
/// A color in the sRGB color space.
|
/// A color in the sRGB color space.
|
||||||
|
|
@ -116,7 +116,7 @@ impl Color {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "colors")]
|
#[cfg(feature = "palette")]
|
||||||
/// Convert from palette's [`Srgba`] type to a [`Color`]
|
/// Convert from palette's [`Srgba`] type to a [`Color`]
|
||||||
///
|
///
|
||||||
/// [`Srgba`]: ../palette/rgb/type.Srgba.html
|
/// [`Srgba`]: ../palette/rgb/type.Srgba.html
|
||||||
|
|
@ -125,7 +125,7 @@ impl Color {
|
||||||
Color::new(srgba.red, srgba.green, srgba.blue, srgba.alpha)
|
Color::new(srgba.red, srgba.green, srgba.blue, srgba.alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "colors")]
|
#[cfg(feature = "palette")]
|
||||||
/// Convert from [`Color`] to palette's [`Srgba`] type
|
/// Convert from [`Color`] to palette's [`Srgba`] type
|
||||||
///
|
///
|
||||||
/// [`Color`]: struct.Color.html
|
/// [`Color`]: struct.Color.html
|
||||||
|
|
@ -159,7 +159,7 @@ impl From<[f32; 4]> for Color {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "colors")]
|
#[cfg(feature = "palette")]
|
||||||
/// Convert from palette's [`Srgba`] type to a [`Color`]
|
/// Convert from palette's [`Srgba`] type to a [`Color`]
|
||||||
///
|
///
|
||||||
/// [`Srgba`]: ../palette/rgb/type.Srgba.html
|
/// [`Srgba`]: ../palette/rgb/type.Srgba.html
|
||||||
|
|
@ -170,7 +170,7 @@ impl From<Srgba> for Color {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "colors")]
|
#[cfg(feature = "palette")]
|
||||||
/// Convert from [`Color`] to palette's [`Srgba`] type
|
/// Convert from [`Color`] to palette's [`Srgba`] type
|
||||||
///
|
///
|
||||||
/// [`Color`]: struct.Color.html
|
/// [`Color`]: struct.Color.html
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue