Change background color of dim effect?
See original GitHub issueHi, good day!
Firstly, great work! I was trying out react-native-drawer and I noticed that the dim effect ( the area which is not covered by the side drawer ) is always white with opacity.
I’ve already tried the following:
const drawerStyles = {
drawer: {
shadowColor: '#000000', shadowOpacity: 0.8, shadowRadius: 3
},
main: { paddingLeft: 3 }
}
However, the dim effect is still in white.
May i know if there’s any API to change the dim color?
Cheers!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How can I change default black dim background "color ...
This is a workaround but it's not really a pure solution because background touch is disabled and should be configured manually.
Read more >Changing background color on dim? : r/WatchMaker
EDIT : Apparently the answer is that, YES, background color can only be set for 'bright' mode, and automatically turns to solid black...
Read more >How to set up an environment in Dimension
Select the environment · Click the Background swatch · Use the Color Picker to select a color or set an image to use...
Read more >background-color - CSS: Cascading Style Sheets | MDN
The background-color CSS property sets the background color of an element. Try it. CSS Demo: background-color. Reset. background- ...
Read more >How to Dim a Picture in CSS
Using both attributes ensures that all browsers can change your image's opacity. Add this class reference to an image to make it dim....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Finally got this working as expected:
tweenHandler={ratio => ({ main: { opacity: 1, }, mainOverlay: { opacity: ratio / 2, backgroundColor: ‘black’, }, })}
The key is to have the opacity of the main always at 1 (stop the main area fading out), and setting the mainOverlay opacity between 0 and % of ratio (currently 50%).
just
tweenHandler={(ratio) => { return { mainOverlay: { opacity: ratio, backgroundColor: ‘black’ } } }}