Commit f7d85691 authored by Maciej Suminski's avatar Maciej Suminski

Added conversion from EDA_COLOR_T to COLOR4D.

parent 26f6e259
...@@ -28,6 +28,15 @@ ...@@ -28,6 +28,15 @@
using namespace KiGfx; using namespace KiGfx;
COLOR4D::COLOR4D( EDA_COLOR_T aColor )
{
r = g_ColorRefs[aColor].m_Red;
g = g_ColorRefs[aColor].m_Green;
b = g_ColorRefs[aColor].m_Blue;
a = 1.0;
}
const bool COLOR4D::operator==( const COLOR4D& aColor ) const bool COLOR4D::operator==( const COLOR4D& aColor )
{ {
return a == aColor.a && r == aColor.r && g == aColor.g && b == aColor.b; return a == aColor.a && r == aColor.r && g == aColor.g && b == aColor.b;
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#ifndef COLOR4D_H_ #ifndef COLOR4D_H_
#define COLOR4D_H_ #define COLOR4D_H_
#include <colors.h>
namespace KiGfx namespace KiGfx
{ {
/** /**
...@@ -55,6 +57,14 @@ public: ...@@ -55,6 +57,14 @@ public:
{ {
} }
/**
* @brief Constructor
*
* @param aColor is one of KiCad's palette colors.
* @see EDA_COLOR_T
*/
COLOR4D( EDA_COLOR_T aColor );
/** /**
* Function Highlight * Function Highlight
* Makes the color brighter by a given factor. * Makes the color brighter by a given factor.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment