21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
+
+
-
-
+
|
*/
#import <ObjFW/ObjFW.h>
#include <QColor>
@interface OFColor (QColor)
@property (readonly, nonatomic) QColor qColor;
+ (instancetype)colorWithQColor: (const QColor &)qColor;
- (instancetype)initWithQColor: (const QColor &)qColor;
- (QColor)qColor;
@end
namespace ObjQt {
static OF_INLINE OFColor *
toOF(const QColor &qColor)
{
if (!qColor.isValid())
return nil;
return [OFColor colorWithQColor: qColor];
}
static OF_INLINE QColor
toQt(OFColor *color)
{
if (color == nil)
return QColor();
return [color qColor];
return color.qColor;
}
}
|