diff --git a/wrap/qt/col_qt_convert.h b/wrap/qt/col_qt_convert.h new file mode 100644 index 00000000..c42daea5 --- /dev/null +++ b/wrap/qt/col_qt_convert.h @@ -0,0 +1,26 @@ +#ifndef COL_QT_CONVERT_H_ +#define COL_QT_CONVERT_H_ + +#include +#include "../../vcg/space/color4.h" + +namespace vcg +{ + class ColorConverter + { + public: + template + static vcg::Color4 convertQColorToColor4(const QColor& col) + { + return vcg::Color4(T(col.red()),T(col.green()),T(col.blue()),T(col.alpha())); + } + + template + static QColor convertColor4ToQColor(const vcg::Color4& col) + { + return QColor(int(col.X()),int(col.Y()),int(col.Z()),int(col.W())); + } + }; +} + +#endif \ No newline at end of file