Enum StyleColor

Source
#[non_exhaustive]
#[repr(u32)]
pub enum StyleColor {
Show 55 variants Text = 0, TextDisabled = 1, WindowBg = 2, ChildBg = 3, PopupBg = 4, Border = 5, BorderShadow = 6, FrameBg = 7, FrameBgHovered = 8, FrameBgActive = 9, TitleBg = 10, TitleBgActive = 11, TitleBgCollapsed = 12, MenuBarBg = 13, ScrollbarBg = 14, ScrollbarGrab = 15, ScrollbarGrabHovered = 16, ScrollbarGrabActive = 17, CheckMark = 18, SliderGrab = 19, SliderGrabActive = 20, Button = 21, ButtonHovered = 22, ButtonActive = 23, Header = 24, HeaderHovered = 25, HeaderActive = 26, Separator = 27, SeparatorHovered = 28, SeparatorActive = 29, ResizeGrip = 30, ResizeGripHovered = 31, ResizeGripActive = 32, Tab = 33, TabHovered = 34, TabActive = 35, TabUnfocused = 36, TabUnfocusedActive = 37, DockingPreview = 38, DockingEmptyBg = 39, PlotLines = 40, PlotLinesHovered = 41, PlotHistogram = 42, PlotHistogramHovered = 43, TableHeaderBg = 44, TableBorderStrong = 45, TableBorderLight = 46, TableRowBg = 47, TableRowBgAlt = 48, TextSelectedBg = 49, DragDropTarget = 50, NavHighlight = 51, NavWindowingHighlight = 52, NavWindowingDimBg = 53, ModalWindowDimBg = 54,
}
Expand description

A color identifier for styling.

Which color does what can sometimes be be unobvious. A good way to find a particular color is to use the crate::Ui::show_default_style_editor window, set a color to a very bright color, and explore the crate::Ui::show_demo_window until you spot it

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Text = 0

Default color of text througout application

§

TextDisabled = 1

Text in areas disabled e.g via crate::Ui::begin_disabled

§

WindowBg = 2

Background of normal windows

§

ChildBg = 3

Background of child windows

§

PopupBg = 4

Background of popups, menus, tooltips windows

§

Border = 5

Border around windows, frames, etc

§

BorderShadow = 6

Used for a drop-shadow/emboss style effect wherever Border is used

§

FrameBg = 7

Background of checkbox, radio button, plot, slider, text input

§

FrameBgHovered = 8

Same as FrameBg but when mouse is hovering over the widget

§

FrameBgActive = 9

Same as FrameBg but when the mouse is active (e.g mouse is down)

§

TitleBg = 10

Window title for inactive windows. Also used as the “docked window tab area” when docking is enabled.

§

TitleBgActive = 11

Window title for active windows.

§

TitleBgCollapsed = 12

Color of a floating window when it is “rolled up”

§

MenuBarBg = 13

Main menu bar background, see crate::Ui::main_menu_bar

§

ScrollbarBg = 14

Background area of scrollbar

§

ScrollbarGrab = 15

Movable area of scollbar when “idle”

§

ScrollbarGrabHovered = 16

Moveable area of scrollbar when mouse is over it

§

ScrollbarGrabActive = 17

Moveable area of scollbar when it is being clicked on

§

CheckMark = 18

The color of the tick character inside the checkbox

§

SliderGrab = 19

Color of interactive handle inside various slider widgets

§

SliderGrabActive = 20

Interactive handle when being clicked on

§

Button = 21

Main frame color of default button

§

ButtonHovered = 22

Button when mouse hovers over it

§

ButtonActive = 23

Button when mouse is down

§

Header = 24

Inactive color for header sections, such as crate::Ui::collapsing_header

§

HeaderHovered = 25

As with Header but when hovered

§

HeaderActive = 26

As with Header but when mouse is down

§

Separator = 27

Dividing line, e.g crate::Ui::separator

§

SeparatorHovered = 28

Dividing line when mouse hovered

§

SeparatorActive = 29

Dividing line when mouse button down

§

ResizeGrip = 30

Resize handle on windows

§

ResizeGripHovered = 31

Resize handle when mouse hovered over handle

§

ResizeGripActive = 32

Resize handle when mouse button down

§

Tab = 33

Inactive tab color. Applies to both tab widgets and docked windows

§

TabHovered = 34

Hovered tab (applies regardless if tab is active, or is in the active window)

§

TabActive = 35

Color of currently selected tab

§

TabUnfocused = 36

Non-selected, when in an unfocused window

§

TabUnfocusedActive = 37

Selected tab, in an unfocused window

§

DockingPreview = 38

Color of widget which appears when moving windows around, allowing splitting/etc of dock areas

§

DockingEmptyBg = 39

Colour when black area is present in docking setup (e.g while dragging a window away from a split area, leaving it temporarily empty)

§

PlotLines = 40

§

PlotLinesHovered = 41

PlotLines when hovered

§

PlotHistogram = 42

§

PlotHistogramHovered = 43

PlotHistogram when hovered

§

TableHeaderBg = 44

Background color of header rows in table widget

§

TableBorderStrong = 45

Main border color for table, used around whole table and around header cells

§

TableBorderLight = 46

Used within border to separate cells

§

TableRowBg = 47

Background of cells in table

§

TableRowBgAlt = 48

Used for alternating row colors, if enabled by TableFlags::ROW_BG

§

TextSelectedBg = 49

The highlight color used for selection in text inputs

§

DragDropTarget = 50

Used for drag-and-drop system

§

NavHighlight = 51

Gamepad/keyboard: current highlighted item

§

NavWindowingHighlight = 52

Highlight window when using CTRL+TAB

§

NavWindowingDimBg = 53

Darken/colorize entire screen behind the CTRL+TAB window list, when active

§

ModalWindowDimBg = 54

Darken/colorize entire screen behind a modal window, when one is active

Implementations§

Source§

impl StyleColor

Source

pub const VARIANTS: [StyleColor; 55]

All possible StyleColor variants

Source

pub const COUNT: usize = 55usize

Total count of StyleColor variants

Source

pub fn name(&self) -> &'static str

Returns the name of the Style Color.

Trait Implementations§

Source§

impl Clone for StyleColor

Source§

fn clone(&self) -> StyleColor

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StyleColor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StyleColor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for StyleColor

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Index<StyleColor> for Style

Source§

type Output = [f32; 4]

The returned type after indexing.
Source§

fn index(&self, index: StyleColor) -> &[f32; 4]

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<StyleColor> for Style

Source§

fn index_mut(&mut self, index: StyleColor) -> &mut [f32; 4]

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl PartialEq for StyleColor

Source§

fn eq(&self, other: &StyleColor) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u32> for StyleColor

Source§

type Error = InvalidStyleColorValue

The type returned in the event of a conversion error.
Source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<usize> for StyleColor

Source§

type Error = InvalidStyleColorValue

The type returned in the event of a conversion error.
Source§

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for StyleColor

Source§

impl Eq for StyleColor

Source§

impl StructuralPartialEq for StyleColor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.