Skip to content
On this page

Effect

This namespace supports changing window transparency/translucent effect.


Effect.current

stringsince v1.0.1

A read-only property that returns the currently applied effect or null if no effect has been applied.

Available effects: mica, acrylic, unified and blurbehind.

Example:

js
console.log(Effect.current)
// mica

Effect.apply(name, options?)

functionsince v1.0.1

A function that takes the name of the desired effect name and an optional object.
It returns a boolean indicating whether the effect was successfully applied or not.

Parameters:

  • name [required] These effect names above to be applied, in string.

  • options [optional] Additional options for the effect, acrylic, unified and blurbehind could have tint color, but mica will ignore this options.

This function returns false if the effect could not be applied, see the System compatibility below.

Example:

js
// enable acrylic on Windows 10
Effect.apply('acrylic')

// with a tint color
Effect.apply('unified', { color: '#4446' })

// mica on windows 11, no options needed
Effect.apply('mica')

INFO

Tint colors must be in CSS hex color format, e.g. #RGB, #RGBA, #RRGGBB, #RRGGBBAA.

To see transparency effect correctly, you should remove all lowest backgrounds.

Effect.clear()

functionsince v1.0.1

A function that clears any currently applied effect, then the Client background will be black.
Using Effect.current after clearing will give you undefined.

Example:

js
// just clear applied effect, even if nothing applied
Effect.clear()

System compatibility

  • On Windows 7, only the blurbehind is supported.
  • On Windows 10, requires build 1703 or higher to use acrylic.
  • mica and unified are only supported on Windows 11, but unified can be enabled on Windows 10 without different from acrylic.

WARNING

On Windows 10 build 1903 (19H1) and higher, enabling acrylic/mica/unified with Transparency effects (in Personalize -> Color settings) will cause lag when moving the Client window.

Listening for changes

Add a listener which will be triggered when effect changed.

js
window.addEventListener('effect-changed', (event) => {
  console.log(event.detail)
})

Released under the WTF License.