NAP
Classes | Enumerations | Functions | Variables
nap::gui Namespace Reference

Classes

struct  ColorPalette
 
struct  Style
 

Enumerations

enum  EColorScheme {
  Light = 0, Dark = 1, HyperDark = 2, Classic = 3,
  Custom = 4
}
 

Functions

const NAPAPI ColorPalettegetPalette (EColorScheme colorScheme)
 
NAPAPI ColorPaletteregisterCustomPalette (const gui::ColorPalette &palette)
 
NAPAPI void applyPalette (const gui::ColorPalette &palette, ImGuiStyle &ioStyle)
 
NAPAPI std::unique_ptr< ImGuiStyle > createStyle (const gui::ColorPalette &palette, const gui::Style &style)
 

Variables

constexpr float dpi = 96.0f
 Default (reference) dpi for gui elements. More...
 
constexpr int pointerInvalidID = -3
 Invalid pointer ID. More...
 
constexpr int pointerMouseID = -2
 Pointer from mouse ID. More...
 
constexpr int pointerTouchID = -1
 Pointer from touch ID. More...
 

Enumeration Type Documentation

◆ EColorScheme

enum EColorScheme
strong

All available color schemes

Enumerator
Light 

Lighter color scheme.

Dark 

Darker color scheme (default)

HyperDark 

High contrast dark color scheme.

Classic 

Classic color scheme.

Custom 

Custom color scheme.

Function Documentation

◆ applyPalette()

NAPAPI void nap::gui::applyPalette ( const gui::ColorPalette palette,
ImGuiStyle &  ioStyle 
)

Helper function, applies a color scheme to the given ImGUI style

Parameters
palettethe color palette to apply
ioStylethe style to apply color palette to

◆ createStyle()

NAPAPI std::unique_ptr<ImGuiStyle> nap::gui::createStyle ( const gui::ColorPalette palette,
const gui::Style style 
)

Helper function, creates an ImGUI compatible style from the given configurable palette and style options

Parameters
palettethe color palette to use
stylethe style to use
Returns
new ImGui compatible style

◆ getPalette()

const NAPAPI ColorPalette* nap::gui::getPalette ( EColorScheme  colorScheme)

Returns the color palette for the given color scheme. Returns a nullptr if the scheme is 'Custom' and no custom color scheme is registered.

Returns
color palette for given color scheme

◆ registerCustomPalette()

NAPAPI ColorPalette& nap::gui::registerCustomPalette ( const gui::ColorPalette palette)

Register a custom color scheme. When called multiple times, previous entries are overridden.

Parameters
palettethe custom color palette
Returns
the color palette in the map

Variable Documentation

◆ dpi

constexpr float dpi = 96.0f
constexpr

Default (reference) dpi for gui elements.

◆ pointerInvalidID

constexpr int pointerInvalidID = -3
constexpr

Invalid pointer ID.

◆ pointerMouseID

constexpr int pointerMouseID = -2
constexpr

Pointer from mouse ID.

◆ pointerTouchID

constexpr int pointerTouchID = -1
constexpr

Pointer from touch ID.