naev 0.12.5
colour.c File Reference

Predefined colours for use with Naev. More...

#include "colour.h"
#include "nmath.h"
Include dependency graph for colour.c:

Go to the source code of this file.

Functions

 __attribute__ ((const))
void col_linearToGamma (glColour *c)
void col_gammaToLinear (glColour *c)
void col_hsv2rgb (glColour *c, float h, float s, float v)
 Changes colour space from HSV to RGB.
void col_rgb2hsv (float *H, float *S, float *V, float R, float G, float B)
 Changes colour space from RGB to HSV.
void col_blend (glColour *blend, const glColour *fg, const glColour *bg, float alpha)
 Blends two colours.

Detailed Description

Predefined colours for use with Naev.

Definition in file colour.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (const) )

Definition at line 21 of file colour.c.

◆ col_blend()

void col_blend ( glColour * blend,
const glColour * fg,
const glColour * bg,
float alpha )

Blends two colours.

Parameters
[out]blendStores blended output colour.
fgForeground colour.
bgBackground colour.
alphaAlpha value to use (0 to 1).

Definition at line 206 of file colour.c.

◆ col_gammaToLinear()

void col_gammaToLinear ( glColour * c)

Definition at line 44 of file colour.c.

◆ col_hsv2rgb()

void col_hsv2rgb ( glColour * c,
float h,
float s,
float v )

Changes colour space from HSV to RGB.

All values go from 0 to 1, except H which is 0-360.

Parameters
[out]cColour to be converted to from hsv.
hHue to convert.
sSaturation to convert.
vValue to convert.

Definition at line 61 of file colour.c.

◆ col_linearToGamma()

void col_linearToGamma ( glColour * c)

Definition at line 37 of file colour.c.

◆ col_rgb2hsv()

void col_rgb2hsv ( float * H,
float * S,
float * V,
float R,
float G,
float B )

Changes colour space from RGB to HSV.

All values go from 0 to 1, except H which is 0-360.

Taken from (GIFT) GNU Image Finding Tool.

Parameters
[out]HStores Hue.
[out]SStores Saturation.
[out]VStores Value.
RRed to convert.
GGreen to convert.
BBlue to convert.

Definition at line 125 of file colour.c.