Overview
Haze is a library providing visual effects (such as blur) for Compose Multiplatform.
Haze is built with Compose Multiplatform, meaning that it supports different platforms:
| Platform | Supported |
|---|---|
| Android | ✅ |
| Desktop (JVM) | ✅ |
| iOS | ✅ |
| Wasm | ✅ |
| JS/Canvas | ✅ |
You can also see it in action in the Tivi app:
Download¶
repositories {
mavenCentral()
}
dependencies {
// Core library. Usually don't need this...
implementation("dev.chrisbanes.haze:haze:<version>")
// For blur effects:
implementation("dev.chrisbanes.haze:haze-blur:<version>")
}
Using Effects
Haze v2 uses a modular architecture where effects are provided as separate modules. The core haze module provides the infrastructure, while effects like blur are in dedicated modules (e.g., haze-blur). If you want to use blur effects, you need the haze-blur dependency. The core haze module alone provides just the base infrastructure for visual effects.
See Architecture for more details about the effect system.
Acknowledgements¶
In previous versions, the Skia-backed implementation (used on iOS and Desktop) was heavily influenced by Kirill Grouchnikov's explorations on Compose Desktop. He wrote about it in his Shader based render effects in Compose Desktop with Skia blog post.
The Android implementation was inspired by the techniques documented by Chet Haase and Nader Jawad in the RenderNode for Bigger, Better Blurs blog post.
Thank you all.
License¶
Copyright 2024 Chris Banes
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.