added Color class
This commit is contained in:
36
Color.hpp
Normal file
36
Color.hpp
Normal 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_
|
Reference in New Issue
Block a user