[TIMOB-6412] Ti API: rgba() Color definitions use different units
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-22T05:10:28.000+0000 |
Affected Version/s | Release 1.7.3 |
Fix Version/s | Release 5.4.0 |
Components | TiAPI |
Labels | parity, tbs-2.1.0 |
Reporter | Arthur Evans |
Assignee | Srikanth Sombhatla |
Created | 2011-12-01T12:55:16.000+0000 |
Updated | 2016-04-22T05:10:28.000+0000 |
Description
Both Android and iOS accept RGBA color definitions in the form:
'rgba(_red_,_green_,_blue_,_alpha_)'
However, Android appears to expect RGBA values 0-255, while iOS expects floating-point values from 0 to 1.
So
'rgba(128,128,128,64)'
Yields a transparent medium-grey on Android, while on iOS you'd need to specify:
'rgba(.5,.5,.5,.25)'
Strangely enough, passing that iOS color value to Android results, not in a transparent color as might be expected, but opaque yellow. It appears on further testing that on Android, any spaces or non-digit characters in the string will have the same result, so:
'rgba(128, 0,128,64)'
==> yellow
'rgba(128,0,128,64)'
==> expected color
This was assigned to me because it was originally opened as an APIDoc bug. However, this is a parity issue.
PR: https://github.com/appcelerator/titanium_mobile/pull/7955
PR merged