Add ColorSpace class

The ColorSpace class can be used to create an RGB color space from
either primaries/whitepoint or an RGB->XYZ matrix.

The primaries and whitepoint are in xyY space. A utility function
is provided to compute xyY coordinates from XYZ coordinats.

The class contains numerous functions to create common RGB color
spaces (sRGB, DCI-P3, etc.).

Test: colorspace_test
Bug: 29940137
Change-Id: Ifba8701377d058f5877176dabf4183e904a4cde0
diff --git a/include/ui/quat.h b/include/ui/quat.h
index 8c89cd7..5b8cd8b 100644
--- a/include/ui/quat.h
+++ b/include/ui/quat.h
@@ -29,6 +29,10 @@
 #define PURE __attribute__((pure))
 #endif
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
+#pragma clang diagnostic ignored "-Wnested-anon-types"
+
 namespace android {
 // -------------------------------------------------------------------------------------
 
@@ -142,48 +146,50 @@
 typedef details::TQuaternion<half> quath;
 
 constexpr inline quat operator"" _i(long double v) {
-    return quat(0, v, 0, 0);
+    return quat(0, static_cast<float>(v), 0, 0);
 }
 constexpr inline quat operator"" _j(long double v) {
-    return quat(0, 0, v, 0);
+    return quat(0, 0, static_cast<float>(v), 0);
 }
 constexpr inline quat operator"" _k(long double v) {
-    return quat(0, 0, 0, v);
+    return quat(0, 0, 0, static_cast<float>(v));
 }
 
 constexpr inline quat operator"" _i(unsigned long long v) {  // NOLINT
-    return quat(0, v, 0, 0);
+    return quat(0, static_cast<float>(v), 0, 0);
 }
 constexpr inline quat operator"" _j(unsigned long long v) {  // NOLINT
-    return quat(0, 0, v, 0);
+    return quat(0, 0, static_cast<float>(v), 0);
 }
 constexpr inline quat operator"" _k(unsigned long long v) {  // NOLINT
-    return quat(0, 0, 0, v);
+    return quat(0, 0, 0, static_cast<float>(v));
 }
 
 constexpr inline quatd operator"" _id(long double v) {
-    return quatd(0, v, 0, 0);
+    return quatd(0, static_cast<double>(v), 0, 0);
 }
 constexpr inline quatd operator"" _jd(long double v) {
-    return quatd(0, 0, v, 0);
+    return quatd(0, 0, static_cast<double>(v), 0);
 }
 constexpr inline quatd operator"" _kd(long double v) {
-    return quatd(0, 0, 0, v);
+    return quatd(0, 0, 0, static_cast<double>(v));
 }
 
 constexpr inline quatd operator"" _id(unsigned long long v) {  // NOLINT
-    return quatd(0, v, 0, 0);
+    return quatd(0, static_cast<double>(v), 0, 0);
 }
 constexpr inline quatd operator"" _jd(unsigned long long v) {  // NOLINT
-    return quatd(0, 0, v, 0);
+    return quatd(0, 0, static_cast<double>(v), 0);
 }
 constexpr inline quatd operator"" _kd(unsigned long long v) {  // NOLINT
-    return quatd(0, 0, 0, v);
+    return quatd(0, 0, 0, static_cast<double>(v));
 }
 
 // ----------------------------------------------------------------------------------------
 }  // namespace android
 
+#pragma clang diagnostic pop
+
 #undef PURE
 
 #endif  // UI_QUAT_H_