question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change background color of dim effect?

See original GitHub issue

Hi, 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:open
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

65reactions
patrickcarnecommented, Jul 14, 2016

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%).

5reactions
jersoncommented, Jun 14, 2016

just

tweenHandler={(ratio) => { return { mainOverlay: { opacity: ratio, backgroundColor: ‘black’ } } }}

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found