diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-26 17:56:43 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-26 17:57:02 +0000 |
| commit | 0948b078e1789605c42746a024df6039bb566b45 (patch) | |
| tree | e3e1a0dfe0cf748343b290f30ef85824993145c8 /src/config/ConfigDataValues.hpp | |
| parent | 52c03569007f3df1a3fc740450db9b4b81d06ca7 (diff) | |
added border gradients
Diffstat (limited to 'src/config/ConfigDataValues.hpp')
| -rw-r--r-- | src/config/ConfigDataValues.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/config/ConfigDataValues.hpp b/src/config/ConfigDataValues.hpp new file mode 100644 index 00000000..f2ea79a0 --- /dev/null +++ b/src/config/ConfigDataValues.hpp @@ -0,0 +1,48 @@ +#pragma once +#include "../defines.hpp" + +enum eConfigValueDataTypes { + CVD_TYPE_INVALID = -1, + CVD_TYPE_GRADIENT = 0 +}; + +interface ICustomConfigValueData { +public: + virtual ~ICustomConfigValueData() = 0; + + virtual eConfigValueDataTypes getDataType() = 0; +}; + +class CGradientValueData : public ICustomConfigValueData { +public: + CGradientValueData(CColor col) { + m_vColors.push_back(col); + }; + virtual ~CGradientValueData() { }; + + virtual eConfigValueDataTypes getDataType() { + return CVD_TYPE_GRADIENT; + } + + void reset(CColor col) { + m_vColors.clear(); + m_vColors.emplace_back(col); + m_fAngle = 0; + } + + /* Vector containing the colors */ + std::vector<CColor> m_vColors; + + /* Float corresponding to the angle (rad) */ + float m_fAngle = 0; + + bool operator==(const CGradientValueData& other) { + if (other.m_vColors.size() != m_vColors.size() || m_fAngle != other.m_fAngle) + return false; + + for (size_t i = 0; i < m_vColors.size(); ++i) + if (m_vColors[i] != other.m_vColors[i]) return false; + + return true; + } +};
\ No newline at end of file |
