pub struct Color { /* private fields */ }
Expand description
A terminal color.
Implementations
sourceimpl Color
impl Color
pub fn new(color_palette: ColorPalette) -> Self
pub fn new_sp(screen: SCREEN, color_palette: ColorPalette) -> Self
sourcepub unsafe fn set_screen(&mut self, screen: Option<SCREEN>)
pub unsafe fn set_screen(&mut self, screen: Option<SCREEN>)
Safety
Set the screen of the Color
.
Use with caution!!! This function only need’s to be used if using the screen type
functions and is provided to allow the alignment of the screen pointer with the
screen that the ColorPair
are for as this crate will apply a screen of None
by default when retriving Attributes
from functions such as attr_get()
and
wattr_get()
.
pub fn screen(&self) -> Option<SCREEN>
pub fn color_palette(&self) -> ColorPalette
pub fn set_rgb(&self, rgb: RGB) -> Result<(), NCurseswError>
pub fn rgb(&self) -> Result<RGB, NCurseswError>
Trait Implementations
sourceimpl ColorPairColors<Colors, Color, i32> for ColorPair
impl ColorPairColors<Colors, Color, i32> for ColorPair
fn colors(&self) -> Result<Colors, NCurseswError>
sourceimpl ColorsType<Color, i32> for Colors
impl ColorsType<Color, i32> for Colors
sourcefn foreground(&self) -> Color
fn foreground(&self) -> Color
Returns the foreground color.
sourcefn background(&self) -> Color
fn background(&self) -> Color
Returns the background color.
impl Copy for Color
impl Eq for Color
impl StructuralEq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations
impl RefUnwindSafe for Color
impl !Send for Color
impl !Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more