LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
color.h File Reference

Color utilities. More...

#include <stdint.h>
Include dependency graph for color.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rgb
 RGB color values. More...

Macros

#define COLOR_BLACK   get_rgb(0, 0, 0)
#define COLOR_BLACK_BRIGHT   get_rgb(128, 128, 128)
#define COLOR_RED   get_rgb(160, 0, 0)
#define COLOR_RED_BRIGHT   get_rgb(255, 50, 50)
#define COLOR_GREEN   get_rgb(0, 160, 0)
#define COLOR_GREEN_BRIGHT   get_rgb(50, 255, 50)
#define COLOR_YELLOW   get_rgb(160, 160, 0)
#define COLOR_YELLOW_BRIGHT   get_rgb(255, 255, 50)
#define COLOR_BLUE   get_rgb(0, 0, 200)
#define COLOR_BLUE_BRIGHT   get_rgb(60, 60, 255)
#define COLOR_MAGENTA   get_rgb(160, 0, 160)
#define COLOR_MAGENTA_BRIGHT   get_rgb(255, 50, 255)
#define COLOR_CYAN   get_rgb(0, 160, 160)
#define COLOR_CYAN_BRIGHT   get_rgb(50, 255, 255)
#define COLOR_WHITE   get_rgb(235, 235, 235)
#define COLOR_WHITE_BRIGHT   get_rgb(255, 255, 255)
#define RGB(r, g, b)

Functions

struct rgb get_rgb (uint8_t r, uint8_t g, uint8_t b)
 Creates an RGB color value from the 3 separate colors.
struct rgb add_rgb (struct rgb a, struct rgb b)
 Adds two RGB color values.
struct rgb sub_rgb (struct rgb a, struct rgb b)
 Subtracts the second RGB color from the first.

Detailed Description

Color utilities.

Author
Matheus Boscariol
Since
19/11/2026

Definition in file color.h.

Macro Definition Documentation

◆ COLOR_BLACK

#define COLOR_BLACK   get_rgb(0, 0, 0)

Definition at line 22 of file color.h.

◆ COLOR_BLACK_BRIGHT

#define COLOR_BLACK_BRIGHT   get_rgb(128, 128, 128)

Definition at line 23 of file color.h.

◆ COLOR_BLUE

#define COLOR_BLUE   get_rgb(0, 0, 200)

Definition at line 34 of file color.h.

◆ COLOR_BLUE_BRIGHT

#define COLOR_BLUE_BRIGHT   get_rgb(60, 60, 255)

Definition at line 35 of file color.h.

◆ COLOR_CYAN

#define COLOR_CYAN   get_rgb(0, 160, 160)

Definition at line 40 of file color.h.

◆ COLOR_CYAN_BRIGHT

#define COLOR_CYAN_BRIGHT   get_rgb(50, 255, 255)

Definition at line 41 of file color.h.

◆ COLOR_GREEN

#define COLOR_GREEN   get_rgb(0, 160, 0)

Definition at line 28 of file color.h.

◆ COLOR_GREEN_BRIGHT

#define COLOR_GREEN_BRIGHT   get_rgb(50, 255, 50)

Definition at line 29 of file color.h.

◆ COLOR_MAGENTA

#define COLOR_MAGENTA   get_rgb(160, 0, 160)

Definition at line 37 of file color.h.

◆ COLOR_MAGENTA_BRIGHT

#define COLOR_MAGENTA_BRIGHT   get_rgb(255, 50, 255)

Definition at line 38 of file color.h.

◆ COLOR_RED

#define COLOR_RED   get_rgb(160, 0, 0)

Definition at line 25 of file color.h.

◆ COLOR_RED_BRIGHT

#define COLOR_RED_BRIGHT   get_rgb(255, 50, 50)

Definition at line 26 of file color.h.

◆ COLOR_WHITE

#define COLOR_WHITE   get_rgb(235, 235, 235)

Definition at line 43 of file color.h.

◆ COLOR_WHITE_BRIGHT

#define COLOR_WHITE_BRIGHT   get_rgb(255, 255, 255)

Definition at line 44 of file color.h.

◆ COLOR_YELLOW

#define COLOR_YELLOW   get_rgb(160, 160, 0)

Definition at line 31 of file color.h.

◆ COLOR_YELLOW_BRIGHT

#define COLOR_YELLOW_BRIGHT   get_rgb(255, 255, 50)

Definition at line 32 of file color.h.

◆ RGB

#define RGB ( r,
g,
b )
Value:
get_rgb(r,g,b)
struct rgb get_rgb(uint8_t r, uint8_t g, uint8_t b)
Creates an RGB color value from the 3 separate colors.
Definition color.c:12

Definition at line 47 of file color.h.

Function Documentation

◆ add_rgb()

struct rgb add_rgb ( struct rgb a,
struct rgb b )

Adds two RGB color values.

Parameters
aFirst color
bSecond color
Returns
The sum of the two colors

Definition at line 22 of file color.c.

Here is the call graph for this function:

◆ get_rgb()

struct rgb get_rgb ( uint8_t r,
uint8_t g,
uint8_t b )

Creates an RGB color value from the 3 separate colors.

Parameters
rRed component
gGreen component
bBlue component
Returns
The RGB color value

Definition at line 12 of file color.c.

Here is the call graph for this function:

◆ sub_rgb()

struct rgb sub_rgb ( struct rgb a,
struct rgb b )

Subtracts the second RGB color from the first.

Parameters
aFirst color
bSecond color
Returns
The difference of the two colors

Definition at line 32 of file color.c.

Here is the call graph for this function: