Is there any effect similar to "Night Reading Mode"?

I am trying to implement a feature for my app, “Night Reading Mode” that reverses the background color from white to black and all texts from black to white.

Instead of changing all the colors for the image/text objects one by one, is there any G2.0 effect/filter that would do the similar thing?

I am thinking to insert a filter in front of all the display objects to simulate this night reading mode, any suggestions?

Thanks.

filter.invert should do the trick.

You can look in the FilterViewer sample app in SampleCode/Graphics-Premium folder to see how it works.  If you’re using storyboard, you probably could apply it to the scene’s view to flip the whole screen.  Dunno if you can apply it to the stage or not.

Rob

No, I can’t apply it to the scene’view by something like this:

function scene:createScene( event )     local group = self.view     group.fill.effect = "filter.invert" end

the fill variable is nil…

Now that I think about it, you’re going to have to have a fill before you can add an effect.   You may have to do something with snapshots to get it to work.  Let me ponder this a bit more.

Rob

I don’t think I can do it with the help of snapshots because the user will use the scroll bar on the screen.

I did a similar thing. I created a rectangle and filled it with “filter.vignetteMask” and put it in front of an image so that the image has the some black blurring circle around it.

@Rob

I just realized when you said snapshots, you are referring to the new G2 snapshot feature (http://www.coronalabs.com/blog/2013/10/22/tutorial-snapshots-in-graphics-2-0/)

I originally thought the snapshot by saving the screen into a file. I think G2 snapshot is probably the right direction. I will think about it too.

Thanks.

filter.invert should do the trick.

You can look in the FilterViewer sample app in SampleCode/Graphics-Premium folder to see how it works.  If you’re using storyboard, you probably could apply it to the scene’s view to flip the whole screen.  Dunno if you can apply it to the stage or not.

Rob

No, I can’t apply it to the scene’view by something like this:

function scene:createScene( event )     local group = self.view     group.fill.effect = "filter.invert" end

the fill variable is nil…

Now that I think about it, you’re going to have to have a fill before you can add an effect.   You may have to do something with snapshots to get it to work.  Let me ponder this a bit more.

Rob

I don’t think I can do it with the help of snapshots because the user will use the scroll bar on the screen.

I did a similar thing. I created a rectangle and filled it with “filter.vignetteMask” and put it in front of an image so that the image has the some black blurring circle around it.

@Rob

I just realized when you said snapshots, you are referring to the new G2 snapshot feature (http://www.coronalabs.com/blog/2013/10/22/tutorial-snapshots-in-graphics-2-0/)

I originally thought the snapshot by saving the screen into a file. I think G2 snapshot is probably the right direction. I will think about it too.

Thanks.