mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +00:00
Add Style::add
This commit is contained in:
parent
770bc86eb2
commit
d9215a2b39
@ -1,4 +1,4 @@
|
|||||||
use super::{ColorStyle, Effect};
|
use super::{ColorStyle, Effect, Color};
|
||||||
use enumset::EnumSet;
|
use enumset::EnumSet;
|
||||||
|
|
||||||
/// Combine a color and an effect.
|
/// Combine a color and an effect.
|
||||||
@ -49,6 +49,11 @@ impl Style {
|
|||||||
|
|
||||||
Style { color, effects }
|
Style { color, effects }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns a combination of `self` and `other`.
|
||||||
|
pub fn add<S>(self, other: S) -> Self where S: Into<Style> {
|
||||||
|
Self::merge(&[self, other.into()])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Effect> for Style {
|
impl From<Effect> for Style {
|
||||||
|
Loading…
Reference in New Issue
Block a user