{ "id": "89831", "key": "TIMOB-8678", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13277", "name": "Sprint 2012-08", "archived": true, "released": true, "releaseDate": "2012-04-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-19T15:38:55.000+0000", "created": "2012-04-11T10:23:36.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "module_window", "qe-testadded" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [ { "id": "16493", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "81745", "key": "TIDOC-258", "fields": { "summary": "APIDoc: Document supported color names", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-13T14:53:18.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": "h2. Problem\r\n\r\nThe logic in colorForHex is incorrect for some color values, specifically color values starting with '#'. This is not notable for colors specified by users, because the hash mark is stripped out before the value is passed to colorForHex. However, the values listed internally, 'aqua', 'fuchsia', 'lime' and 'maroon' are improperly returned as transparent.\r\n\r\ncolorForHex should simply strip the '#' character before interpreting the color values, which would simplify the logic.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\n// According to the following test case:\r\n// Android does not currently support: brown. The color yellow is used when a name is not recognised.\r\n// iOS does not currently support: aqua, fuchsia, lime and maroon. The color black is used when a name is not recognised.\r\n\r\n// stripped for tableview background color still to be tested\r\n\r\nvar webcolor = [\r\n 'black', 'gray', 'darkgray', 'lightgray', 'white', 'red', 'green', 'blue', 'cyan', 'yellow',\r\n 'magenta', 'orange', 'purple', 'brown', 'transparent',\r\n 'aqua', 'fuchsia', 'lime', 'maroon', 'pink', 'navy', 'silver', 'olive', 'teal'];\r\n\r\nvar webcolorPointer = 0;\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: webcolor[webcolorPointer],\r\n exitOnClose: true,\r\n fullscreen: false,\r\n layout: 'vertical',\r\n title: 'Webcolor Demo'\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n backgroundColor: 'white',\r\n text: webcolor[webcolorPointer]\r\n});\r\nwebcolorPointer++;\r\n\r\nwin.add(label);\r\n\r\n// click window to iterate through color array\r\nwin.addEventListener('click', function(e){\r\n e.source.backgroundColor = webcolor[webcolorPointer];\r\n label.text = webcolor[webcolorPointer];\r\n webcolorPointer++;\r\n if(webcolorPointer === webcolor.length){\r\n webcolorPointer = 0;\r\n }\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Webcolor colorForHex returns incorrect values for some strings ", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "191731", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request pending.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-18T17:25:07.000+0000", "updated": "2012-04-18T17:25:07.000+0000" }, { "id": "191936", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR merged https://github.com/appcelerator/titanium_mobile/pull/2033", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-19T15:38:55.000+0000", "updated": "2012-04-19T15:38:55.000+0000" }, { "id": "199000", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 2.1.0.v20120618102300 on iPod 4th Gen\r\n", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T15:54:33.000+0000", "updated": "2012-06-18T15:54:33.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }