scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
color.hpp
Go to the documentation of this file.
1#ifndef SCIFIR_UNITS_SPECIAL_UNITS_COLOR_HPP_INCLUDED
2#define SCIFIR_UNITS_SPECIAL_UNITS_COLOR_HPP_INCLUDED
3
4#include <iostream>
5#include <sstream>
6
7using namespace std;
8
9namespace scifir
10{
11 class color
12 {
13 public:
14 color();
15 color(int,int,int,int = 255);
16
17 inline const int& get_red() const
18 {
19 return red;
20 }
21
22 inline const int& get_green() const
23 {
24 return green;
25 }
26
27 inline const int& get_blue() const
28 {
29 return blue;
30 }
31
32 inline const int& get_alpha() const
33 {
34 return alpha;
35 }
36
37 inline bool is_opaque() const
38 {
39 return (alpha == 255);
40 }
41
42 inline bool is_transparent() const
43 {
44 return (alpha < 255);
45 }
46
47 inline bool is_full_transparent() const
48 {
49 return (alpha == 0);
50 }
51
52 private:
53 int red;
54 int blue;
55 int green;
56 int alpha;
57 };
58}
59
60ostream& operator <<(ostream&, const scifir::color&);
61
62#endif // SCIFIR_UNITS_SPECIAL_UNITS_COLOR_HPP_INCLUDED
const int & get_green() const
Definition color.hpp:22
const int & get_alpha() const
Definition color.hpp:32
bool is_full_transparent() const
Definition color.hpp:47
const int & get_blue() const
Definition color.hpp:27
const int & get_red() const
Definition color.hpp:17
bool is_opaque() const
Definition color.hpp:37
bool is_transparent() const
Definition color.hpp:42
ostream & operator<<(ostream &, const scifir::color &)
Definition color.cpp:16
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition address.cpp:6