added Color class

This commit is contained in:
Bob Polis
2020-10-27 13:42:12 +01:00
parent fb09e7434d
commit a26d082bdb
2 changed files with 114 additions and 0 deletions

36
Color.hpp Normal file
View File

@ -0,0 +1,36 @@
//
// Color.hpp
// screensaver
//
// Created by Bob Polis at 2020-10-27
// Copyright (c) 2020 SwiftCoder. All rights reserved.
//
#ifndef _Color_H_
#define _Color_H_
struct RGB {
double r;
double g;
double b;
};
struct HSB {
double h;
double s;
double b;
};
class Color {
public:
Color(const RGB& rgb);
Color(const HSB& hsb);
operator RGB() const { return _rgb; }
operator HSB() const;
private:
RGB _rgb;
};
#endif // _Color_H_