Socket
Socket
Sign inDemoInstall

cordova-plugin-darkmode

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-plugin-darkmode

A sample for a new cordova plugin to detect dark/inversion color mode


Version published
Maintainers
1
Install size
4.94 kB
Created

Readme

Source

Cordova plugin DarkMode

!! Android only !!

This plugin only detects if dark (also called night) mode is enable or disable on Android. It can tell you if inverted color mode is enabled, too.

This is usefull in case Android WebView on user device is not updated or you are using Crosswalk, otherwise you should use prefer-color-scheme in css.

Install

cordova plugin add cordova-plugin-darkmode

Example

darkmode.isDarkModeEnabled(
    function(res){
        //true/false
        alert("Dark Mode: "+res);
    }, function(err){
        console.err(err);
    });

darkmode.isInversionEnabled(
    function(res){
        //true/false
        alert("Inverted Colors: "+res);
    },
    function(err){
        console.err(err);
    });

Keywords

FAQs

Last updated on 06 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc