Add Style::add
-use super::{ColorStyle, Effect};
+use super::{ColorStyle, Effect, Color};
use enumset::EnumSet;
/// Combine a color and an effect.
@@ -49,6 +49,11 @@ impl Style {
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 {
