summaryrefslogtreecommitdiff
path: root/platform/macos/src/NSColor+MGLAdditions.mm
diff options
context:
space:
mode:
authorFabian Guerra Soto <fabian.guerra@mapbox.com>2019-03-19 14:53:35 -0700
committerGitHub <noreply@github.com>2019-03-19 14:53:35 -0700
commit174c8fa7e4927ebf28a3d0e07c995d3e3d69de76 (patch)
treef503bdf15e24f9c744f634107fc04c6338d1c42d /platform/macos/src/NSColor+MGLAdditions.mm
parent10e1e63aee95f579f951e3c2001640a268d3d95c (diff)
downloadqtlocation-mapboxgl-174c8fa7e4927ebf28a3d0e07c995d3e3d69de76.tar.gz
[ios, macos] Add text-color support to format expressions. (#14146)
Added the possibility of overriding paint properties inside the format expression. Added an example of how to create an MGLAttributedExpression object and documented the attributes keys and value types. Fixed a bug that ignored the font names.
Diffstat (limited to 'platform/macos/src/NSColor+MGLAdditions.mm')
-rw-r--r--platform/macos/src/NSColor+MGLAdditions.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/macos/src/NSColor+MGLAdditions.mm b/platform/macos/src/NSColor+MGLAdditions.mm
index c73c1a41b7..ea7d99f66d 100644
--- a/platform/macos/src/NSColor+MGLAdditions.mm
+++ b/platform/macos/src/NSColor+MGLAdditions.mm
@@ -37,7 +37,7 @@
@implementation NSExpression (MGLColorAdditions)
+ (NSExpression *)mgl_expressionForRGBComponents:(NSArray<NSExpression *> *)components {
- if (NSColor *color = [self mgl_colorWithComponentExpressions:components]) {
+ if (NSColor *color = [self mgl_colorWithRGBComponents:components]) {
return [NSExpression expressionForConstantValue:color];
}
@@ -49,7 +49,7 @@
}
+ (NSExpression *)mgl_expressionForRGBAComponents:(NSArray<NSExpression *> *)components {
- if (NSColor *color = [self mgl_colorWithComponentExpressions:components]) {
+ if (NSColor *color = [self mgl_colorWithRGBComponents:components]) {
return [NSExpression expressionForConstantValue:color];
}
@@ -62,7 +62,7 @@
/**
Returns a color object corresponding to the given component expressions.
*/
-+ (NSColor *)mgl_colorWithComponentExpressions:(NSArray<NSExpression *> *)componentExpressions {
++ (NSColor *)mgl_colorWithRGBComponents:(NSArray<NSExpression *> *)componentExpressions {
// Map the component expressions to constant components. If any component is
// a non-constant expression, the components cannot be converted into a
// constant color value.