summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorYoung Hahn <young@mapbox.com>2016-06-15 11:38:22 -0400
committerGitHub <noreply@github.com>2016-06-15 11:38:22 -0400
commit24b66bc8cdd40a52e08d198c063daa3e1f6be92a (patch)
tree6d98a5e1216a83f7d6d4c78422c8306d4a4cb157 /platform
parentfe64238b4cd5a7da403a4f29a62b14234ecba569 (diff)
downloadqtlocation-mapboxgl-24b66bc8cdd40a52e08d198c063daa3e1f6be92a.tar.gz
Color class (#5361)
* Color class * Switch to list initialization
Diffstat (limited to 'platform')
-rwxr-xr-xplatform/android/src/jni.cpp2
-rw-r--r--platform/darwin/src/MGLMultiPoint.mm4
-rw-r--r--platform/ios/src/MGLMapView.mm4
-rw-r--r--platform/macos/src/MGLMapView.mm4
4 files changed, 7 insertions, 7 deletions
diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp
index 077f574469..a790064d53 100755
--- a/platform/android/src/jni.cpp
+++ b/platform/android/src/jni.cpp
@@ -711,7 +711,7 @@ static mbgl::Color toColor(jint color) {
float g = (color >> 8) & 0xFF;
float b = (color) & 0xFF;
float a = (color >> 24) & 0xFF;
- return {{ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }};
+ return { r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f };
}
template <class Geometry>
diff --git a/platform/darwin/src/MGLMultiPoint.mm b/platform/darwin/src/MGLMultiPoint.mm
index 6084535d05..a5b9eb8efc 100644
--- a/platform/darwin/src/MGLMultiPoint.mm
+++ b/platform/darwin/src/MGLMultiPoint.mm
@@ -5,11 +5,11 @@
mbgl::Color MGLColorObjectFromCGColorRef(CGColorRef cgColor) {
if (!cgColor) {
- return {{ 0, 0, 0, 0 }};
+ return { 0, 0, 0, 0 };
}
NSCAssert(CGColorGetNumberOfComponents(cgColor) >= 4, @"Color must have at least 4 components");
const CGFloat *components = CGColorGetComponents(cgColor);
- return {{ (float)components[0], (float)components[1], (float)components[2], (float)components[3] }};
+ return { (float)components[0], (float)components[1], (float)components[2], (float)components[3] };
}
@implementation MGLMultiPoint
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 4e304b23a5..4c09894a11 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -126,11 +126,11 @@ mbgl::Color MGLColorObjectFromUIColor(UIColor *color)
{
if (!color)
{
- return {{ 0, 0, 0, 0 }};
+ return { 0, 0, 0, 0 };
}
CGFloat r, g, b, a;
[color getRed:&r green:&g blue:&b alpha:&a];
- return {{ (float)r, (float)g, (float)b, (float)a }};
+ return { (float)r, (float)g, (float)b, (float)a };
}
@interface MGLAnnotationAccessibilityElement : UIAccessibilityElement
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 2f985b85d8..07b5259c7e 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -126,11 +126,11 @@ mbgl::util::UnitBezier MGLUnitBezierForMediaTimingFunction(CAMediaTimingFunction
/// Converts the given color into an mbgl::Color in calibrated RGB space.
mbgl::Color MGLColorObjectFromNSColor(NSColor *color) {
if (!color) {
- return {{ 0, 0, 0, 0 }};
+ return { 0, 0, 0, 0 };
}
CGFloat r, g, b, a;
[[color colorUsingColorSpaceName:NSCalibratedRGBColorSpace] getRed:&r green:&g blue:&b alpha:&a];
- return {{ (float)r, (float)g, (float)b, (float)a }};
+ return { (float)r, (float)g, (float)b, (float)a };
}
/// Lightweight container for metadata about an annotation, including the annotation itself.