#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Palette {
pub foreground: ::std::option::Option<::std::string::String>,
pub background: ::std::option::Option<::std::string::String>,
}
impl Palette {
pub fn foreground(&self) -> ::std::option::Option<&str> {
self.foreground.as_deref()
}
pub fn background(&self) -> ::std::option::Option<&str> {
self.background.as_deref()
}
}
impl Palette {
pub fn builder() -> crate::types::builders::PaletteBuilder {
crate::types::builders::PaletteBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PaletteBuilder {
pub(crate) foreground: ::std::option::Option<::std::string::String>,
pub(crate) background: ::std::option::Option<::std::string::String>,
}
impl PaletteBuilder {
pub fn foreground(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.foreground = ::std::option::Option::Some(input.into());
self
}
pub fn set_foreground(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.foreground = input;
self
}
pub fn get_foreground(&self) -> &::std::option::Option<::std::string::String> {
&self.foreground
}
pub fn background(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.background = ::std::option::Option::Some(input.into());
self
}
pub fn set_background(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.background = input;
self
}
pub fn get_background(&self) -> &::std::option::Option<::std::string::String> {
&self.background
}
pub fn build(self) -> crate::types::Palette {
crate::types::Palette {
foreground: self.foreground,
background: self.background,
}
}
}