From 844a8244097c18ae12e9c14baaaaad8a2f7ef436 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Thu, 3 May 2018 09:11:42 -0400 Subject: [ios, macos] Fix broken link to predicates and expressions guide. (#11818) --- platform/darwin/docs/guides/For Style Authors.md.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/darwin/docs/guides') diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 2ae6602224..b0ded7bc03 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -272,7 +272,7 @@ Each property representing a layout or paint attribute is set to an but you create the former using a very different syntax. `NSExpression`’s format string syntax is reminiscent of a spreadsheet formula or an expression in a database query. See the -“[Predicates and Expressions](Predicates and Expressions.md)” guide for an +“[Predicates and Expressions](predicates-and-expressions.html)” guide for an overview of the expression support in this SDK. This SDK no longer supports style functions; use expressions instead. @@ -427,5 +427,5 @@ In style JSON | In the format string `["any", f0, …, fn]` | `p0 OR … OR pn` `["none", f0, …, fn]` | `NOT (p0 OR … OR pn)` -See the “[Predicates and Expressions](Predicates and Expressions.md)” guide for +See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for a full description of the supported operators and operand types. -- cgit v1.2.1 From a425995189c3f4c9d9040b4acff477bfc96b6afd Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Mon, 7 May 2018 12:01:29 -0400 Subject: [ios, macos] Add to-rgba expression operator. (#11725) * [ios, macos] Add expression support to to-rgba operator. * [ios, macos] Update style docs. * [ios, macos] Refactored to-rgba to to-color. * [ios, macos] Add support for to-rgba expression operator. * [ios, macos] Add multiple parameters support to to-color operand. * [ios, macos] Enable to-rgba operator for MGLColor or key path expressions. * [ios, macos] Update predicates and expressions guide to reflect cast changes. * [ios, macos] Update changelogs. * [ios, macos] Clarify color casting usage. --- platform/darwin/docs/guides/For Style Authors.md.ejs | 4 ++-- platform/darwin/docs/guides/Predicates and Expressions.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'platform/darwin/docs/guides') diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index b0ded7bc03..60177e57c2 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -335,7 +335,7 @@ In style specification | Method, function, or predicate type | Format string syn `number` | | `string` | | `to-boolean` | `boolValue` | -`to-color` | | +`to-color` | | `CAST(var, '<%- cocoaPrefix %>Color')` `to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')` `to-string` | `stringValue` | `CAST(ele, 'NSString')` `typeof` | | @@ -372,7 +372,7 @@ In style specification | Method, function, or predicate type | Format string syn `rgb` | `+[UIColor colorWithRed:green:blue:alpha:]` | `rgba` | `+[UIColor colorWithRed:green:blue:alpha:]` | <% } -%> -`to-rgba` | | +`to-rgba` | | `CAST(noindex(var), 'NSArray')` `-` | `from:subtract:` | `2 - 1` `*` | `multiply:by:` | `1 * 2` `/` | `divide:by:` | `1 / 2` diff --git a/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/darwin/docs/guides/Predicates and Expressions.md index c3b3d39a52..18eccda569 100644 --- a/platform/darwin/docs/guides/Predicates and Expressions.md +++ b/platform/darwin/docs/guides/Predicates and Expressions.md @@ -70,6 +70,8 @@ path or variable into a matching type: * To cast a value to a number, use `CAST(key, 'NSNumber')`. * To cast a value to a string, use `CAST(key, 'NSString')`. +* To cast a value to a color, use `CAST(key, 'UIColor')` on iOS and `CAST(key, 'NSColor')` on macOS. +* To cast an `NSColor` or `UIColor` object to an array, use `CAST(noindex(color), 'NSArray')`. For details about the predicate format string syntax, consult the “Predicate Format String Syntax” chapter of the -- cgit v1.2.1