-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
we have a lot of duplication implementation for a method in StyledText;
/// Sets the `bright_white` color to the input text.
///
/// # Example:
/// ```
/// use vitalux::styled;
/// let styled_text = styled("The present is all we have to live in . . . or to lose.").bright_white().paint();
/// ```
pub fn bright_white(&mut self) -> &mut Self {
self.start_styles.push(basic_color::BRIGHT_WHITE);
self
}
// Formatters
/// Sets the `reset` effect to the input text.
///
/// # Example:
/// ```
/// use vitalux::styled;
/// let styled_text = styled("The present is all we have to live in . . . or to lose.").red().reset().paint();
/// ```
/// ** this will reset all the effects, colors and formatters that are called before this**
/// so in the top example the red color will never applied to the input text
pub fn reset(&mut self) -> &mut Self {
self.start_styles.push(formatter::RESET);
self
}what if we use macro to create these implementation for us?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested