diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-08-21 16:04:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-21 16:04:22 -0700 |
commit | d6c8463da8a7cf0098f716693d0b7507dfe79763 (patch) | |
tree | af062796cff714444a519230c3a86f3083f5a575 /platform/darwin/scripts/generate-style-code.js | |
parent | ea41ed0769059334b4c0a959c0a0ef909ed57bee (diff) | |
download | qtlocation-mapboxgl-d6c8463da8a7cf0098f716693d0b7507dfe79763.tar.gz |
[ios, macos] Copyedit default color property documentation (#6105)
* [ios, macos] Fixed typo in color property docs
* [ios, macos] Predefined colors as default color property values
Use {NS,UI}Color.blackColor and {NS,UI}Color.whiteColor as aliases for common default color values.
Diffstat (limited to 'platform/darwin/scripts/generate-style-code.js')
-rw-r--r-- | platform/darwin/scripts/generate-style-code.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index 36c5e55c37..8da0fac399 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -169,7 +169,13 @@ global.describeValue = function (value, property, layerType) { if (!color) { throw new Error(`unrecognized color format in default value of ${property.name}`); } - return 'an `NSColor` or `UIColor`' + `object whose RGB value is ${color.r}, ${color.g}, ${color.b} and whose alpha value is ${color.a}`; + if (color.r === 0 && color.g === 0 && color.b === 0) { + return '`blackColor`' + ` with an alpha value of ${color.a}`; + } + if (color.r === 1 && color.g === 1 && color.b === 1) { + return '`whiteColor`' + ` with an alpha value of ${color.a}`; + } + return 'an `NSColor` or `UIColor`' + ` object whose RGB value is ${color.r}, ${color.g}, ${color.b} and whose alpha value is ${color.a}`; case 'array': let units = property.units || ''; if (units) { |