Browse Source

Added nvgTransRGBAf

shared-context
Doug Binks 11 years ago
parent
commit
253dc627e7
2 changed files with 9 additions and 0 deletions
  1. +6
    -0
      src/nanovg.c
  2. +3
    -0
      src/nanovg.h

+ 6
- 0
src/nanovg.c View File

@@ -306,6 +306,12 @@ struct NVGcolor nvgTransRGBA(struct NVGcolor c, unsigned char a)
return c;
}

struct NVGcolor nvgTransRGBAf(struct NVGcolor c, float a)
{
c.a = a;
return c;
}

struct NVGcolor nvgLerpRGBA(struct NVGcolor c0, struct NVGcolor c1, float u)
{
int i;


+ 3
- 0
src/nanovg.h View File

@@ -133,6 +133,9 @@ struct NVGcolor nvgLerpRGBA(struct NVGcolor c0, struct NVGcolor c1, float u);
// Sets transparency of a color value.
struct NVGcolor nvgTransRGBA(struct NVGcolor c0, unsigned char a);

// Sets transparency of a color value.
struct NVGcolor nvgTransRGBAf(struct NVGcolor c0, float a);

// Returns color value specified by hue, saturation and lightness.
// HSL values are all in range [0..1], alpha will be set to 255.
struct NVGcolor nvgHSL(float h, float s, float l);


Loading…
Cancel
Save