Feature name colors -> palette

This commit is contained in:
Clark Moody 2020-03-31 16:44:02 -05:00
parent e926e43742
commit 7b15e4b0e2
3 changed files with 6 additions and 9 deletions

View file

@ -25,7 +25,7 @@ tokio = ["iced_futures/tokio"]
# Enables `async-std` as the `executor::Default` on native platforms
async-std = ["iced_futures/async-std"]
# Enables advanced color conversion via `palette`
colors = ["iced_core/colors"]
palette = ["iced_core/palette"]
[badges]
maintenance = { status = "actively-developed" }

View file

@ -7,9 +7,6 @@ description = "The essential concepts of Iced"
license = "MIT"
repository = "https://github.com/hecrj/iced"
[features]
colors = ["palette"]
[dependencies]
[dependencies.palette]

View file

@ -1,4 +1,4 @@
#[cfg(feature = "colors")]
#[cfg(feature = "palette")]
use palette::rgb::Srgba;
/// 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`]
///
/// [`Srgba`]: ../palette/rgb/type.Srgba.html
@ -125,7 +125,7 @@ impl Color {
Color::new(srgba.red, srgba.green, srgba.blue, srgba.alpha)
}
#[cfg(feature = "colors")]
#[cfg(feature = "palette")]
/// Convert from [`Color`] to palette's [`Srgba`] type
///
/// [`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`]
///
/// [`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
///
/// [`Color`]: struct.Color.html