VCV Rack API v2
Loading...
Searching...
No Matches
color.hpp File Reference
#include <nanovg.h>
#include <common.hpp>
#include <string.hpp>
Include dependency graph for color.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  rack
 Root namespace for the Rack API.
 
namespace  rack::color
 Utilities for NVGcolor
 

Functions

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

Variables

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