summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLAttributionInfo.mm
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-03-06 00:32:12 -0800
committerMinh Nguyễn <mxn@1ec5.org>2018-03-07 17:31:01 -0800
commit6c0599b536cb3f2e6e583b3e33fc6bcc547cda37 (patch)
tree432d9c801f688d1b8b0e3b6aa76454256952af76 /platform/darwin/src/MGLAttributionInfo.mm
parent12664cd4c42b20e513146ddab1f17d8c3da0a6e7 (diff)
downloadqtlocation-mapboxgl-6c0599b536cb3f2e6e583b3e33fc6bcc547cda37.tar.gz
[macos] Assume sRGB for mbgl expressions, CSS in attribution
Assume mbgl needs colors in the sRGB color space rather than the calibrated RGB color space. Fixed link colors when creating attribution from HTML.
Diffstat (limited to 'platform/darwin/src/MGLAttributionInfo.mm')
-rw-r--r--platform/darwin/src/MGLAttributionInfo.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLAttributionInfo.mm b/platform/darwin/src/MGLAttributionInfo.mm
index 73147270c1..07d10e852b 100644
--- a/platform/darwin/src/MGLAttributionInfo.mm
+++ b/platform/darwin/src/MGLAttributionInfo.mm
@@ -49,7 +49,12 @@
CGFloat blue;
CGFloat alpha;
#if !TARGET_OS_IPHONE
- linkColor = [linkColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
+ // CSS uses the sRGB color space.
+ if ([NSColor redColor].colorSpaceName == NSCalibratedRGBColorSpace) {
+ linkColor = [linkColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
+ } else {
+ linkColor = [linkColor colorUsingColorSpace:[NSColorSpace sRGBColorSpace]];
+ }
#endif
[linkColor getRed:&red green:&green blue:&blue alpha:&alpha];
[css appendFormat: