{ "id": "62810", "key": "TIMOB-2178", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11239", "name": "Release 1.6.0 M06", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:19.000+0000", "created": "2011-04-15T03:12:51.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "defect", "gradient", "ios", "iphone", "release-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:19.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Running on the iphone, setting a background gradient color to\nblack does not work, Setting it to 000001 does work however.

\n

Code:
\nvar win = Ti.UI.currentWindow;

\n

var view = Titanium.UI.createView({

\n
\ntop:0,\nleft:0,\n//height:height,\n//width:width,\nbackgroundGradient:{\n        type:'linear',\n        colors:[{color:'#50FFFF',position:0.0},{color:'#000000',position:1.0}]\n    }\n
\n

});

\n

win.add(view);

\n

HD ticket
\nhttp://developer.appcelerator.com/helpdesk/view/51211

{html}", "attachment": [], "flagged": false, "summary": "Black does not work in a background gradient iOS", "creator": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "127746", "author": { "name": "jacobrelkin", "key": "jacobrelkin", "displayName": "Jacob Relkin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Apparently the reason why this isn't working is because [UIColor\nblackColor]'s color space model is\nkCGColorSpaceModelMonochrome.
\nCAGradientLayer does not accept colors that are in the\nkCGColorSpaceMonochrome color space model.

\n

The fix for this is to check if the color space is\nkcGColorSpaceModelMonochrome, and if it is, re-assign the\ngradient's color to the RGB representation of the color by using\nUIColor's colorWithRed:green:blue:alpha: method.

\n

Here's a screenshot of it in action:

\n

http://cl.ly/3u282l072k3g1O1F1x01

{html}", "updateAuthor": { "name": "jacobrelkin", "key": "jacobrelkin", "displayName": "Jacob Relkin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:12:52.000+0000", "updated": "2011-04-15T03:12:52.000+0000" }, { "id": "127747", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [e2c1e33e2196f82f790db9282ce9612fd24e2b75])\n[#2178 state:fixed-in-qa] [#2837\nstate:fixed-in-qa] Updating formatting for TiGradient to house\nstyle. Actual bug fixes were done by Jacob. See https://github.com/appcelerator/titanium_mobile/pull/58\n\nhttps://github.com/appcelerator/titanium_mobile/commit/e2c1e33e2196...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:12:52.000+0000", "updated": "2011-04-15T03:12:52.000+0000" }, { "id": "127748", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Added test to Integrity, validated fix.

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:12:52.000+0000", "updated": "2011-04-15T03:12:52.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }