# cordova-plugin-darkmode

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

Latest version **1.0.0** (published 2019-09-06) · Apache-2 license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-darkmode
pnpm add cordova-plugin-darkmode
yarn add cordova-plugin-darkmode
bun add cordova-plugin-darkmode
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-09-06 |
| First published | 2019-09-06 |
| Weekly downloads | 0 |
| License | Apache-2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | OpenMove team |
| Maintainers | openmove |
| Keywords | cordova, plugin, darkmode, ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-darkmode
- Repository: https://github.com/openmove/cordova-darkmode-plugin
- Homepage: https://openmove.com
- Issues: https://github.com/openmove/cordova-darkmode-plugin
- npm.io page: https://npm.io/package/cordova-plugin-darkmode

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-09-06

## README

# 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**](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) in css.

### Install
```
cordova plugin add cordova-plugin-darkmode
```

### Example
```js
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);
    });
```

---
_Source: https://npm.io/package/cordova-plugin-darkmode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
