4
property real v_r: color.r
5
property real v_g: color.g
6
property real v_b: color.b
7
property real v_a: color.a
8
property variant copy: color
9
property string colorToString: color.toString()
11
// compare different colors
12
property bool colorEqualsIdenticalRgba: (color == Qt.rgba(0.2, 0.88, 0.6, 0.34)) // true
13
property bool colorEqualsDifferentAlpha: (color == Qt.rgba(0.2, 0.88, 0.6, 0.44)) // false
14
property bool colorEqualsDifferentRgba: (color == Qt.rgba(0.3, 0.98, 0.7, 0.44)) // false
16
// compare different color.toString()s
17
property bool colorToStringEqualsColorString: (color.toString() == colorToString) // true
18
property bool colorToStringEqualsDifferentAlphaString: (color.toString() == Qt.rgba(0.2, 0.88, 0.6, 0.44).toString()) // true
19
property bool colorToStringEqualsDifferentRgbaString: (color.toString() == Qt.rgba(0.3, 0.98, 0.7, 0.44).toString()) // false
21
// compare colors to strings
22
property bool colorEqualsColorString: (color == colorToString) // false
23
property bool colorEqualsDifferentAlphaString: (color == Qt.rgba(0.2, 0.88, 0.6, 0.44).toString()) // false
24
property bool colorEqualsDifferentRgbaString: (color == Qt.rgba(0.3, 0.98, 0.7, 0.44).toString()) // false
26
// compare colors to various value types
27
property bool equalsColor: (color == Qt.rgba(0.2, 0.88, 0.6, 0.34)) // true
28
property bool equalsVector3d: (color == Qt.vector3d(1, 2, 3)) // false
29
property bool equalsSize: (color == Qt.size(1912, 1913)) // false
30
property bool equalsPoint: (color == Qt.point(10, 4)) // false
31
property bool equalsRect: (color == Qt.rect(2, 3, 109, 102)) // false
33
// ensure comparison directionality doesn't matter
34
property bool equalsColorRHS: (Qt.rgba(0.2, 0.88, 0.6, 0.34) == color) // true
35
property bool colorEqualsCopy: (color == copy) // true
36
property bool copyEqualsColor: (copy == color) // true