Molybden API
Loading...
Searching...
No Matches
color.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_COLOR_HPP
6#define MOLYBDEN_COLOR_HPP
7
8#include <string>
9
10namespace molybden {
11
23struct Color {
24 Color(float red, float green, float blue, float alpha);
25
26 Color(float red, float green, float blue);
27
32 bool isValid() const;
33
38 std::string hexRGBA() const;
39
44 std::string hexRGB() const;
45
49 float red = 0.0;
50
54 float green = 0.0;
55
59 float blue = 0.0;
60
65 float alpha = 0.0;
66};
67
68} // namespace molybden
69
70#endif // MOLYBDEN_COLOR_HPP
A numeric model of an RGB color.
Definition color.hpp:23
bool isValid() const
Indicates whether this color is a valid color.
float alpha
The opacity channel value in the {0..1} range.
Definition color.hpp:65
std::string hexRGBA() const
Returns a string representation for this color in the RGBA hex format or an empty string when this co...
float blue
The blue channel value in the {0..1} range.
Definition color.hpp:59
float green
The green channel value in the {0..1} range.
Definition color.hpp:54
std::string hexRGB() const
Returns a string representation for this color in the RGB hex format or an empty string when this col...
float red
The red channel value in the {0..1} range.
Definition color.hpp:49