5#include <SimoxUtility/color/Color.h>
7#include <RobotAPI/interface/ArViz/Elements.h>
14 using data::Color::Color;
28 Color(
int r,
int g,
int b,
int a = 255)
30 this->r = simox::color::to_byte(r);
31 this->g = simox::color::to_byte(g);
32 this->b = simox::color::to_byte(b);
33 this->a = simox::color::to_byte(a);
36 Color(
float r,
float g,
float b,
float a = 1.0)
38 this->r = simox::color::to_byte(r);
39 this->g = simox::color::to_byte(g);
40 this->b = simox::color::to_byte(b);
41 this->a = simox::color::to_byte(a);
53 fromRGBA(
float r,
float g,
float b,
float a = 1.0)
70 return simox::Color::black(a);
76 return simox::Color::white(a);
80 gray(
int g = 128,
int a = 255)
82 return simox::Color::gray(g, a);
88 red(
int r = 255,
int a = 255)
90 return simox::Color::red(r, a);
96 return simox::Color::green(g, a);
102 return simox::Color::blue(b, a);
111 return simox::Color::cyan(
c, a);
118 return simox::Color::yellow(y, a);
125 return simox::Color::magenta(m, a);
134 return simox::Color::orange(o, a);
141 return simox::Color::pink(p, a);
148 return simox::Color::lime(l, a);
155 return simox::Color::turquoise(t, a);
162 return simox::Color::azure(az, a);
169 return simox::Color::purple(p, a);
176 return os <<
"(" << int(
c.r) <<
" " << int(
c.g) <<
" " << int(
c.b) <<
" | " << int(
c.a)
183 return lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b && lhs.a == rhs.a;
189 return !(lhs == rhs);
196 operator==(
const viz::data::Color& lhs,
const simox::color::Color& rhs)
198 return lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b && lhs.a == rhs.a;
203 operator==(
const simox::color::Color& lhs,
const armarx::viz::data::Color& rhs)
209 operator<<(std::ostream& os,
const viz::data::Color&
c)
211 return os <<
"(" << int(
c.r) <<
" " << int(
c.g) <<
" " << int(
c.b) <<
" | " << int(
c.a)
std::ostream & operator<<(std::ostream &os, const viz::data::Color &c)
bool operator==(const viz::data::Color &lhs, const simox::color::Color &rhs)
This file is part of ArmarX.
bool operator!=(const Color &lhs, const Color &rhs)
bool operator==(const Color &lhs, const Color &rhs)
std::ostream & operator<<(std::ostream &os, const Color &c)
Color(int r, int g, int b, int a=255)
static Color blue(int b=255, int a=255)
static Color red(int r=255, int a=255)
static Color orange(int o=255, int a=255)
2 Red + 1 Green
static Color turquoise(int t=255, int a=255)
2 Green + 1 Blue
static Color yellow(int y=255, int a=255)
Red + Green.
Color(float r, float g, float b, float a=1.0)
static Color purple(int p=255, int a=255)
2 Blue + 1 Red
static Color fromRGBA(float r, float g, float b, float a=1.0)
Construct a float color from R, G, B and optional alpha.
static Color fromRGBA(simox::Color c)
Construct from a simox Color.
static Color magenta(int m=255, int a=255)
Red + Blue.
static Color azure(int az=255, int a=255)
2 Blue + 1 Green
static Color gray(int g=128, int a=255)
static Color white(int a=255)
static Color black(int a=255)
static Color green(int g=255, int a=255)
static Color cyan(int c=255, int a=255)
Green + Blue.
static Color lime(int l=255, int a=255)
2 Green + 1 Red
static Color fromRGBA(int r, int g, int b, int a=255)
Construct a byte color from R, G, B and optional alpha.
Color(const data::Color &c)
static Color pink(int p=255, int a=255)
2 Red + 1 Blue