JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Color.hpp
Go to the documentation of this file.
1// Copyright 2012-2024 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include "Rgb.hpp"
8
9namespace jngl {
10
28class Color {
29public:
33 Color(unsigned char red, unsigned char green, unsigned char blue);
34
36 unsigned char getRed() const;
38 void setRed(unsigned char);
39
41 unsigned char getGreen() const;
43 void setGreen(unsigned char);
44
46 unsigned char getBlue() const;
48 void setBlue(unsigned char);
49
50private:
51 unsigned char red;
52 unsigned char green;
53 unsigned char blue;
54};
55
58
61
64[[deprecated("use setBackgroundColor(jngl::Rgb) instead")]]
65void setBackgroundColor(unsigned char red, unsigned char green, unsigned char blue);
66
67} // namespace jngl
Contains jngl::Rgb class.
Object representing a RGB color.
Definition Color.hpp:28
Color(unsigned char red, unsigned char green, unsigned char blue)
unsigned char getBlue() const
0...255
void setBlue(unsigned char)
0...255
void setGreen(unsigned char)
0...255
void setRed(unsigned char)
0...255
unsigned char getRed() const
0...255
unsigned char getGreen() const
0...255
Object representing a RGB color, new version of jngl::Color (which will be deprecated in the future)
Definition Rgb.hpp:15
JNGL's main namespace.
Color interpolate(Color a, Color b, float t)
Returns a color mix between a (t == 0) and b (t == 1)
void setBackgroundColor(jngl::Rgb)
Sets the screen's background color which is visible when nothing is drawn.