2009-10-02 11:55:31 +02:00
|
|
|
#ifndef COL_QT_CONVERT_H_
|
|
|
|
#define COL_QT_CONVERT_H_
|
|
|
|
|
|
|
|
#include <QColor>
|
|
|
|
#include "../../vcg/space/color4.h"
|
|
|
|
|
|
|
|
namespace vcg
|
|
|
|
{
|
|
|
|
class ColorConverter
|
|
|
|
{
|
|
|
|
public:
|
2009-11-05 23:32:26 +01:00
|
|
|
inline static vcg::Color4b ToColor4b(const QColor& col)
|
2009-10-02 11:55:31 +02:00
|
|
|
{
|
2009-11-05 23:32:26 +01:00
|
|
|
return vcg::Color4b(col.red(),col.green(),col.blue(),col.alpha());
|
2009-10-02 11:55:31 +02:00
|
|
|
}
|
|
|
|
|
2009-11-05 23:32:26 +01:00
|
|
|
inline static QColor ToQColor(const vcg::Color4b& col)
|
2009-10-02 11:55:31 +02:00
|
|
|
{
|
2009-11-05 23:32:26 +01:00
|
|
|
return QColor(col[0],col[1],col[2],col[3]);
|
2009-10-02 11:55:31 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|