6.0.0 • Published 22 days ago

@capacitor-community/screen-brightness v6.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

Maintainers

MaintainerGitHubSocial
Ely Lucaselylucas@elylucas

Versions

PluginCapacitorDocumentation
6.x6.xREADME
5.x5.xREADME
4.x4.xREADME
1.x3.xREADME

Installation

npm install @capacitor-community/screen-brightness
npx cap sync

Configuration

No configuration required for this plugin

Usage

import { ScreenBrightness } from '@capacitor-community/screen-brightness';

// Set the brightness:
const brightness = 0.5;
await ScreenBrightness.setBrightness({ brightness });

// Get the current brightness:
const {brightness: currentBrightness} = await ScreenBrightness.getBrightness();

API

setBrightness(...)

setBrightness(options: SetBrightnessOptions) => Promise<void>

Sets the brightness level. On iOS, it sets the system level brightness, and on Android it sets the brightness for the current view.

ParamTypeDescription
optionsSetBrightnessOptionsOptions to set brightness

Since: 1.0.0


getBrightness()

getBrightness() => Promise<GetBrightnessReturnValue>

Returns info than contains the current brightness level

  • @since 1.0.0

Returns: Promise<GetBrightnessReturnValue>


Interfaces

SetBrightnessOptions

PropTypeDescriptionSince
brightnessnumberThe level to set the brightness to, from 0.0 (very dim) to 1.0 (full brightness) On Android, setting the value to -1 restores the user configured brightness.1.0.0

GetBrightnessReturnValue

PropTypeDescriptionSince
brightnessnumberThe current brightness level, from 0.0 (very dim) to 1.0 (full brightness) On Android it returns -1 if the value has not been changed by the app.1.0.0
6.0.0

22 days ago

5.0.0

1 year ago

4.0.0

2 years ago

2.0.0-0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago