React-native: [Android] borderColor is broken for transparent colors

Created on 24 Oct 2015  路  22Comments  路  Source: facebook/react-native

Setting borderColor: "rgba(255, 255, 255, 0.5)" works but borderColor: "rgba(255, 255, 255, 0.6)" gives a black border.

Expected:
screen shot 2015-10-24 at 10 39 16 am

Android:
screen shot 2015-10-24 at 10 39 10 am

Sample app: https://rnplay.org/apps/l1bw2A

Good first issue Help Wanted Locked

Most helpful comment

I'll work on it. anyone who has already started, please let me know here.

All 22 comments

@cosmith Is this still an issue?

Sorry for the delay, still an issue on 0.16 but I haven't had the time to upgrade to 0.17 or 0.18.

I'm seeing this in 0.17, however opacity of 0.5 also appears as black.

I'm also seeing this in 0.17 on Android

I've tried a number of combinations...for e.g.

mystyle: { height:1, borderBottomWidth:1, borderColor:'rgba(255,255,255,0.5)', borderTopWidth:0, borderLeftWidth:0, borderRightWidth:0, },

Seeing this on master, seems related to color parsing? cc @andreicoman11

Can confirm on 0.18, still an issue.

+1

Happening in 0.22 still. Black border for any alpha value except 1.0.

Happening still in 0.23.0-rc. It seems like instead of a real opacity being calculated, a different color value is being applied. So, the blacks turn into greys, but are fully opaque.

Still happening on 0.23-rc1

anybody working on this??

Still happening on 0.26 on Android

I have the same issue with 0.26 on ios as well.

Still happens on 0.27.2

@foghina, @andreicoman11, Is fixing this issue scheduled or in a backlog?

Not that I know of. Added some tags to encourage people to send a PR to fix it :)

+1

Waiting for the fix.

I'll work on it. anyone who has already started, please let me know here.

Hi all, I have a pull request to fix this here: https://github.com/facebook/react-native/pull/9380

Problem had to do with storing int value as float. This is lossy when converting back to int for very large numbers. To solve this I split color (ARGB) into RGB and Alpha values to be stored separately.

screen shot 2016-08-12 at 5 49 42 pm

Many thanks to @foghina for reviewing and getting the pull request merged in today - if @cosmith and others here can confirm this bug is fixed that would be appreciated!

Closing this due to 8095707

Let's reopen if it's not fixed.

Was this page helpful?
0 / 5 - 0 ratings