VCV Rack API v2
rack::color Namespace Reference

Utilities for NVGcolor More...

Functions

bool isEqual (NVGcolor a, NVGcolor b)
 
NVGcolor clamp (NVGcolor a)
 Limits color components between 0 and 1. More...
 
NVGcolor minus (NVGcolor a, NVGcolor b)
 Subtracts color components elementwise. More...
 
NVGcolor plus (NVGcolor a, NVGcolor b)
 Adds color components elementwise. More...
 
NVGcolor mult (NVGcolor a, NVGcolor b)
 Multiplies color components elementwise. More...
 
NVGcolor mult (NVGcolor a, float x)
 
NVGcolor screen (NVGcolor a, NVGcolor b)
 Screen blending with alpha compositing. More...
 
NVGcolor alpha (NVGcolor a, float alpha)
 Multiplies alpha value. More...
 
NVGcolor fromHexString (std::string s)
 Converts from color hex string of the form "#RRGGBB" or "#RRGGBBAA". More...
 
std::string toHexString (NVGcolor c)
 

Variables

static const NVGcolor BLACK_TRANSPARENT = nvgRGBA(0x00, 0x00, 0x00, 0x00)
 
static const NVGcolor WHITE_TRANSPARENT = nvgRGBA(0xff, 0xff, 0xff, 0x00)
 
static const NVGcolor BLACK = nvgRGB(0x00, 0x00, 0x00)
 
static const NVGcolor RED = nvgRGB(0xff, 0x00, 0x00)
 
static const NVGcolor GREEN = nvgRGB(0x00, 0xff, 0x00)
 
static const NVGcolor BLUE = nvgRGB(0x00, 0x00, 0xff)
 
static const NVGcolor CYAN = nvgRGB(0x00, 0xff, 0xff)
 
static const NVGcolor MAGENTA = nvgRGB(0xff, 0x00, 0xff)
 
static const NVGcolor YELLOW = nvgRGB(0xff, 0xff, 0x00)
 
static const NVGcolor WHITE = nvgRGB(0xff, 0xff, 0xff)
 

Detailed Description

Utilities for NVGcolor

Function Documentation

◆ isEqual()

bool rack::color::isEqual ( NVGcolor  a,
NVGcolor  b 
)

◆ clamp()

NVGcolor rack::color::clamp ( NVGcolor  a)

Limits color components between 0 and 1.

◆ minus()

NVGcolor rack::color::minus ( NVGcolor  a,
NVGcolor  b 
)

Subtracts color components elementwise.

◆ plus()

NVGcolor rack::color::plus ( NVGcolor  a,
NVGcolor  b 
)

Adds color components elementwise.

◆ mult() [1/2]

NVGcolor rack::color::mult ( NVGcolor  a,
NVGcolor  b 
)

Multiplies color components elementwise.

◆ mult() [2/2]

NVGcolor rack::color::mult ( NVGcolor  a,
float  x 
)

◆ screen()

NVGcolor rack::color::screen ( NVGcolor  a,
NVGcolor  b 
)

Screen blending with alpha compositing.

◆ alpha()

NVGcolor rack::color::alpha ( NVGcolor  a,
float  alpha 
)

Multiplies alpha value.

◆ fromHexString()

NVGcolor rack::color::fromHexString ( std::string  s)

Converts from color hex string of the form "#RRGGBB" or "#RRGGBBAA".

Returns WHITE on error.

◆ toHexString()

std::string rack::color::toHexString ( NVGcolor  c)

Variable Documentation

◆ BLACK_TRANSPARENT

const NVGcolor rack::color::BLACK_TRANSPARENT = nvgRGBA(0x00, 0x00, 0x00, 0x00)
static

◆ WHITE_TRANSPARENT

const NVGcolor rack::color::WHITE_TRANSPARENT = nvgRGBA(0xff, 0xff, 0xff, 0x00)
static

◆ BLACK

const NVGcolor rack::color::BLACK = nvgRGB(0x00, 0x00, 0x00)
static

◆ RED

const NVGcolor rack::color::RED = nvgRGB(0xff, 0x00, 0x00)
static

◆ GREEN

const NVGcolor rack::color::GREEN = nvgRGB(0x00, 0xff, 0x00)
static

◆ BLUE

const NVGcolor rack::color::BLUE = nvgRGB(0x00, 0x00, 0xff)
static

◆ CYAN

const NVGcolor rack::color::CYAN = nvgRGB(0x00, 0xff, 0xff)
static

◆ MAGENTA

const NVGcolor rack::color::MAGENTA = nvgRGB(0xff, 0x00, 0xff)
static

◆ YELLOW

const NVGcolor rack::color::YELLOW = nvgRGB(0xff, 0xff, 0x00)
static

◆ WHITE

const NVGcolor rack::color::WHITE = nvgRGB(0xff, 0xff, 0xff)
static