### Property: start Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-linear-gradient/start.html Defines the starting position of the gradient. ```APIDOC ## Property: start ### Description Defines the starting position of the gradient. ### Parameters #### Path Parameters - **start** (Offset) - Optional - Starting position of the gradient. Defaults to Offset.Zero which represents the top-left of the drawing area. ``` -------------------------------- ### Add Haze Dependency Source: https://chrisbanes.github.io/haze/1.7.2 Include the Haze library in your project's dependencies to start using its features. Ensure you have mavenCentral() configured in your repositories. ```gradle repositories { mavenCentral() } dependencies { implementation("dev.chrisbanes.haze:haze:") } ``` -------------------------------- ### Constructor Initialization Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-input-scale/-fixed/-fixed.html Documentation for the Haze constructor method used to initialize the library with a specific scale factor. ```APIDOC ## Constructor ### Description Initializes the Haze library with a specified scale factor. ### Parameters #### Path Parameters - **scale** (Float) - Required - The scale factor, in the range 0 < x <= 1. ``` -------------------------------- ### Fading Haze Effect with Scroll Source: https://chrisbanes.github.io/haze/1.7.2/usage Control the haze effect's alpha based on scroll state. This example fades the blur effect in or out as the user scrolls, using the first visible item's offset and size. ```kotlin FooAppBar( ... modifier = Modifier .hazeEffect(state = hazeState) { alpha = if (listState.firstVisibleItemIndex == 0) { listState.layoutInfo.visibleItemsInfo.first().let { (it.offset / it.size.height.toFloat()).absoluteValue } } else { alpha = 1f } }, ) ``` -------------------------------- ### startIntensity Configuration Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-linear-gradient/start-intensity.html Configures the initial intensity of the haze effect. ```APIDOC ## startIntensity ### Description Sets the intensity of the haze effect at its starting point. ### Method Not Applicable (Property Configuration) ### Endpoint Not Applicable (Property Configuration) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **startIntensity** (Float) - Required - The intensity of the haze effect at the start, in the range `0f`..`1f`. ### Request Example ```json { "startIntensity": 0.5 } ``` ### Response #### Success Response (200) Not Applicable (Property Configuration) #### Response Example Not Applicable (Property Configuration) ``` -------------------------------- ### Auto Input Scaling Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-input-scale/-auto/index.html Haze provides an 'Auto' option for input scaling, which intelligently selects an appropriate scale based on the current configuration. This feature aims to simplify setup by automatically managing input scale settings. ```APIDOC ## Auto Input Scaling ### Description Automatic input scaling. Haze will attempt to use an appropriate input scale depending on the other settings which have been set. The values used underneath may change in the future. ### Method Not Applicable (Configuration Setting) ### Endpoint Not Applicable (Configuration Setting) ### Parameters This is a configuration setting, not an API endpoint. No parameters are directly applicable in the context of an API call. ### Request Example This is a configuration setting, not an API request. ### Response This is a configuration setting, not an API response. ``` -------------------------------- ### HazeSourceNode Constructor Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-source-node/index.html Initializes a new instance of the HazeSourceNode class. ```APIDOC ## HazeSourceNode Constructor ### Description Initializes a new instance of the HazeSourceNode class. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### HazeArea Constructor Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-area/index.html Initializes a new instance of the HazeArea class. ```APIDOC ## HazeArea Constructor ### Description Initializes a new instance of the HazeArea class. ### Method constructor() ### Endpoint N/A (Class Constructor) ### Parameters None ### Request Body None ### Response N/A (Constructor) ``` -------------------------------- ### HazeTint Constructors Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-tint/-haze-tint.html Initializes a new instance of HazeTint using either a Color or a Brush. ```APIDOC ## HazeTint Constructors ### Description Initializes a HazeTint object to apply tinting effects. Supports initialization via a solid color or a complex brush. ### Constructors - **HazeTint(color: Color, blendMode: BlendMode)** - **HazeTint(brush: Brush, blendMode: BlendMode)** ### Parameters - **color** (Color) - Required - The solid color to use for the tint. - **brush** (Brush) - Required - The brush to use for the tint. - **blendMode** (BlendMode) - Optional - The blend mode to apply. Defaults to DefaultBlendMode. ``` -------------------------------- ### HazeTint Constructors Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-tint/index.html Provides information on how to create HazeTint objects using either a Color or a Brush. ```APIDOC ## HazeTint Constructors ### Description Constructors for creating HazeTint objects. ### Constructor 1 ```kotlin constructor(color: Color, blendMode: BlendMode = DefaultBlendMode) ``` ### Constructor 2 ```kotlin constructor(brush: Brush, blendMode: BlendMode = DefaultBlendMode) ``` ``` -------------------------------- ### Configure Input Scaling for Haze Source: https://chrisbanes.github.io/haze/1.7.2/usage Sets the input scale to optimize performance by blurring lower-resolution content. ```kotlin LargeTopAppBar( // ... modifier = Modifier.hazeEffect(hazeState) { inputScale = HazeInputScale.Auto } ) ``` -------------------------------- ### Apply Haze Material Style Source: https://chrisbanes.github.io/haze/1.7.2/materials Use HazeMaterials.thin() to apply a thin material style to a LargeTopAppBar. ```kotlin Box { // rest of sample from above LargeTopAppBar( modifier = Modifier .hazeEffect( ... style = HazeMaterials.thin(), ), ) } ``` -------------------------------- ### FluentMaterials - mica Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a translucent application background material. ```APIDOC ## mica ### Description A HazeStyle which implements a translucent application background material. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.mica() ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for mica background ``` ``` -------------------------------- ### FluentMaterials - mica Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a translucent application background material. ```APIDOC ## mica ### Description A HazeStyle which implements a translucent application background material. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### HazeEffectNode Constructor Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-effect-node/index.html Initializes a new instance of the HazeEffectNode class. ```APIDOC ## HazeEffectNode Constructor ### Description Initializes a new instance of the HazeEffectNode class with optional state, style, and a block for defining the haze effect scope. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ``` -------------------------------- ### Implement Haze with Scaffold Source: https://chrisbanes.github.io/haze/1.7.2/recipes Applies haze effects to top and bottom bars while setting the content as the haze source. Ensure app bar colors are set to transparent to allow the blur effect to be visible. ```kotlin val hazeState = rememberHazeState() Scaffold( topBar = { TopAppBar( // Need to make app bar transparent to see the content behind colors = TopAppBarDefaults.largeTopAppBarColors(Color.Transparent), modifier = Modifier .hazeEffect(state = hazeState) .fillMaxWidth(), ) { /* todo */ } }, bottomBar = { NavigationBar( containerColor = Color.Transparent, modifier = Modifier .hazeEffect(state = hazeState) .fillMaxWidth(), ) { /* todo */ } }, ) { LazyVerticalGrid( modifier = Modifier .hazeSource( state = hazeState, style = HazeDefaults.style(backgroundColor = MaterialTheme.colorScheme.surface), ), ) { // todo } } ``` -------------------------------- ### HazeProgressive Implementations Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/index.html Overview of the HazeProgressive interface and its available implementations for blur effects. ```APIDOC ## HazeProgressive Interface ### Description An immutable interface for applying a progressive blur effect. ### Inheritors - **Brush**: A progressive effect derived by using a Brush as an alpha mask. - **LinearGradient**: A linear gradient effect. - **RadialGradient**: A radial gradient effect. ## LinearGradient ### Parameters - **easing** (Easing) - Optional - The easing curve to apply (default: EaseIn). - **start** (Offset) - Optional - The start offset (default: Offset.Zero). - **startIntensity** (Float) - Optional - The intensity at the start (default: 0.0f). - **end** (Offset) - Optional - The end offset (default: Offset.Infinite). - **endIntensity** (Float) - Optional - The intensity at the end (default: 1.0f). - **preferPerformance** (Boolean) - Optional - Whether to prioritize performance (default: false). ## RadialGradient ### Parameters - **easing** (Easing) - Optional - The easing curve to apply (default: EaseIn). - **center** (Offset) - Optional - The center offset (default: Offset.Unspecified). - **centerIntensity** (Float) - Optional - The intensity at the center (default: 1.0f). - **radius** (Float) - Optional - The radius of the gradient (default: Float.POSITIVE_INFINITY). - **radiusIntensity** (Float) - Optional - The intensity at the radius (default: 0.0f). ## Brush ### Parameters - **brush** (Brush) - Required - The brush used as an alpha mask. ``` -------------------------------- ### HazeProgressive Implementations Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive Overview of the HazeProgressive interface and its available implementations for blur effects. ```APIDOC ## HazeProgressive ### Description An immutable interface for applying a progressive blur effect. ### Inheritors - **Brush**: A progressive effect derived by using the provided Brush as an alpha mask. - **LinearGradient**: A linear gradient effect. - **RadialGradient**: A radial gradient effect. ## LinearGradient ### Parameters - **easing** (Easing) - Optional - The easing curve to use (default: EaseIn). - **start** (Offset) - Optional - The start offset (default: Offset.Zero). - **startIntensity** (Float) - Optional - The intensity at the start (default: 0.0f). - **end** (Offset) - Optional - The end offset (default: Offset.Infinite). - **endIntensity** (Float) - Optional - The intensity at the end (default: 1.0f). - **preferPerformance** (Boolean) - Optional - Whether to prefer performance over quality (default: false). ## RadialGradient ### Parameters - **easing** (Easing) - Optional - The easing curve to use (default: EaseIn). - **center** (Offset) - Optional - The center offset (default: Offset.Unspecified). - **centerIntensity** (Float) - Optional - The intensity at the center (default: 1.0f). - **radius** (Float) - Optional - The radius of the gradient (default: Float.POSITIVE_INFINITY). - **radiusIntensity** (Float) - Optional - The intensity at the radius (default: 0.0f). ## Brush ### Parameters - **brush** (Brush) - Required - The brush to use as an alpha mask. ``` -------------------------------- ### FluentMaterials - micaAlt Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a translucent application background material, suitable for tab experiences. ```APIDOC ## micaAlt ### Description A HazeStyle which implements a translucent application background material used for the tab experience. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.micaAlt(isDark = true) ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for mica alt background ``` ``` -------------------------------- ### FluentMaterials - micaAlt Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a translucent application background material, suitable for tab experiences. ```APIDOC ## micaAlt ### Description A HazeStyle which implements a translucent application background material used for the tab experience. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### Brush Class Definition Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-brush/index.html Documentation for the Brush class constructor and properties. ```APIDOC ## Brush Class ### Description A progressive effect which is derived by using the provided Brush as an alpha mask. This allows custom effects driven from a brush, such as a bitmap shader or ShaderBrush. The RGB values from the brush's pixels are ignored; only the alpha values are used. ### Constructors - **Brush(brush: Brush)** - Creates a new instance of Brush using the provided brush. ### Properties - **brush** (Brush) - The underlying brush used as an alpha mask. ``` -------------------------------- ### Create a shader-based brush Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-companion Builds a HazeProgressive.Brush using a custom shader, providing the content size to the block. ```kotlin inline fun forShader( crossinline block: (Size) -> Shader): HazeProgressive.Brush ``` -------------------------------- ### Create an ultraThin material HazeStyle Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-cupertino-materials/index.html Generates a mostly translucent material style, offering the lowest opacity level. ```kotlin @Composable @ReadOnlyComposable fun ultraThin(containerColor: Color = MaterialTheme.colorScheme.surface): HazeStyle ``` -------------------------------- ### HazeStyle Constructor Overload 1 Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-style/-haze-style.html This constructor allows for the creation of a HazeStyle with a specified background color, a list of tints, a blur radius, a noise factor, and a fallback tint. ```APIDOC ## HazeStyle(backgroundColor: Color, tints: List, blurRadius: Dp, noiseFactor: Float, fallbackTint: HazeTint) ### Description Creates a HazeStyle with the specified parameters. ### Parameters - **backgroundColor** (Color) - The background color for the haze effect. Defaults to `Color.Unspecified`. - **tints** (List) - A list of tints to apply to the haze effect. Defaults to an empty list. - **blurRadius** (Dp) - The radius of the blur effect. Defaults to `Dp.Unspecified`. - **noiseFactor** (Float) - The factor controlling the noise in the haze effect. Defaults to -1f. - **fallbackTint** (HazeTint) - The tint to use as a fallback. Defaults to `HazeTint.Unspecified`. ``` -------------------------------- ### HazeStyle Constructor Overload 2 Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-style/-haze-style.html This constructor allows for the creation of a HazeStyle with a specified background color, a single tint, a blur radius, a noise factor, and a fallback tint. ```APIDOC ## HazeStyle(backgroundColor: Color, tint: HazeTint?, blurRadius: Dp, noiseFactor: Float, fallbackTint: HazeTint) ### Description Creates a HazeStyle with the specified parameters, using a single tint. ### Parameters - **backgroundColor** (Color) - The background color for the haze effect. Defaults to `Color.Unspecified`. - **tint** (HazeTint?) - A single tint to apply to the haze effect. Can be null. Defaults to `null`. - **blurRadius** (Dp) - The radius of the blur effect. Defaults to `Dp.Unspecified`. - **noiseFactor** (Float) - The factor controlling the noise in the haze effect. Defaults to -1f. - **fallbackTint** (HazeTint) - The tint to use as a fallback. Defaults to `HazeTint.Unspecified`. ``` -------------------------------- ### preferPerformance Configuration Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-linear-gradient/prefer-performance.html Configuration option to control whether Haze prioritizes performance or quality. ```APIDOC ## preferPerformance ### Description Controls whether Haze should prefer performance (when true) or quality (when false). ### Method N/A (Configuration Option) ### Endpoint N/A (Configuration Option) ### Parameters #### Query Parameters - **preferPerformance** (Boolean) - Required - Whether Haze should prefer performance (true) or quality (false). ``` -------------------------------- ### Create HazeProgressive.Brush with Shader Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-companion/for-shader.html Use this helper function to create a HazeProgressive.Brush with a Shader. The provided block receives the content size, allowing for shader configuration based on dimensions. ```kotlin inline fun forShader(crossinline block: (Size) -> Shader): HazeProgressive.Brush ``` -------------------------------- ### Fixed Class Definition Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-input-scale/-fixed/index.html Documentation for the Fixed class constructor and properties. ```APIDOC ## Fixed Class ### Description An input scale which uses a fixed scale factor for Haze processing. ### Constructors - **Fixed(scale: Float)** ### Parameters - **scale** (Float) - Required - The scale factor, in the range 0 < x <= 1. ### Properties - **scale** (Float) - The scale factor value. ``` -------------------------------- ### Implement Haze with Sticky Headers Source: https://chrisbanes.github.io/haze/1.7.2/recipes Applies the haze effect to sticky headers by setting the haze source on individual list items instead of the parent container to avoid recursive drawing. ```kotlin val hazeState = rememberHazeState() LazyColumn(...) { stickyHeader { Header( modifier = Modifier .hazeEffect(state = hazeState), ) } items(list) { item -> Foo( modifier = Modifier .hazeSource(hazeState), ) } } ``` -------------------------------- ### HazeState Class Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-state/index.html Details about the HazeState class, its constructors, and properties. ```APIDOC ## Class HazeState @Stable class HazeState(initialBlurEnabled: Boolean) ### Description Represents the state of haze effects, including blur enablement. ### Constructors #### HazeState() - **Description**: Default constructor for HazeState. #### HazeState(initialBlurEnabled: Boolean) - **Description**: Constructor for HazeState with an initial blur enabled state. - **Parameters**: - **initialBlurEnabled** (Boolean) - Required - The initial state of blur. ### Properties #### areas - **Type**: List - **Description**: Represents the areas affected by haze. #### blurEnabled - **Type**: Boolean - **Description**: Whether blurring is enabled or not. This can be overridden on each hazeEffect via the HazeEffectScope.blurEnabled property. - **Mutability**: Mutable (var) #### contentLayer - **Type**: GraphicsLayer? - **Description**: Represents the content layer (deprecated). - **Mutability**: Mutable (var) #### positionOnScreen - **Type**: Offset - **Description**: Represents the position on the screen (deprecated). - **Mutability**: Mutable (var) ``` -------------------------------- ### FluentMaterials - acrylicDefault Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a translucent material, suitable for popup container backgrounds. ```APIDOC ## acrylicDefault ### Description A HazeStyle which implements a translucent material used for the popup container background. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.acrylicDefault(isDark = false) ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for acrylic default ``` ``` -------------------------------- ### FluentMaterials - acrylicDefault Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a translucent material, suitable for popup container backgrounds. ```APIDOC ## acrylicDefault ### Description A HazeStyle which implements a translucent material used for the popup container background. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### Basic Background Blurring Source: https://chrisbanes.github.io/haze/1.7.2/usage Implement basic background blurring by applying hazeSource to the scrollable content and hazeEffect to the element that should appear blurred. Ensure the app bar is transparent to see the effect. ```kotlin val hazeState = rememberHazeState() Box { LazyColumn( modifier = Modifier .fillMaxSize() // Pass it the HazeState we stored above .hazeSource(state = hazeState) ) { // todo } LargeTopAppBar( // Need to make app bar transparent to see the content behind colors = TopAppBarDefaults.largeTopAppBarColors(Color.Transparent), modifier = Modifier // We use hazeEffect on anything where we want the background // blurred. .hazeEffect(state = hazeState, style = HazeMaterials.ultraThin()) .fillMaxWidth(), ) } ``` -------------------------------- ### FluentMaterials - thinAcrylic Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a mostly translucent material. ```APIDOC ## thinAcrylic ### Description A HazeStyle which implements a mostly translucent material. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.thinAcrylic() ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for thin acrylic ``` ``` -------------------------------- ### FluentMaterials - thinAcrylic Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a mostly translucent material. ```APIDOC ## thinAcrylic ### Description A HazeStyle which implements a mostly translucent material. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### HazeStyle Constructor Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-style Constructs a new HazeStyle instance with specified properties. This constructor allows for defining background color, a list of tints, blur radius, noise factor, and a fallback tint. ```APIDOC ## HazeStyle Constructor ### Description Constructs a new HazeStyle instance with specified properties. This constructor allows for defining background color, a list of tints, blur radius, noise factor, and a fallback tint. ### Parameters * **backgroundColor** (Color) - Optional - Color to draw behind the blurred content. Typically `MaterialTheme.colorScheme.surface` or similar. * **tints** (List) - Optional - The HazeTints to apply to the blurred content. * **blurRadius** (Dp) - Optional - Radius of the blur. * **noiseFactor** (Float) - Optional - Amount of noise applied to the content, in the range `0f` to `1f`. Anything outside of that range will be clamped. * **fallbackTint** (HazeTint) - Optional - The HazeTint to use when Haze uses the fallback scrim functionality. When the fallback tint is used, the tints provided in tints are ignored. ``` -------------------------------- ### Create a thin material HazeStyle Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-cupertino-materials/index.html Generates a translucent material style, positioned between ultraThin and regular in terms of opacity. ```kotlin @Composable @ReadOnlyComposable fun thin( containerColor: Color = MaterialTheme.colorScheme.surface): HazeStyle ``` -------------------------------- ### Property: inputScale Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-effect-scope/input-scale.html Configures the scaling factor for content before blur application to balance performance and visual quality. ```APIDOC ## Property: inputScale ### Description The input scale factor determines the resolution at which content is processed for the blur effect. Scaling down (values < 1.0) can improve performance at the cost of visual crispness. ### Type `HazeInputScale` (abstract var) ### Constraints - Range: 0 < x <= 1 - Default: 1.0 ### Usage Notes - Values around 0.8 provide a ~35% reduction in resolution with minimal visual impact. - Values around 0.5 reduce pixel count to 25% of original, which may be visually perceptible. - This feature is experimental and subject to removal. ``` -------------------------------- ### HazeStyle Constructor with Single Tint Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-style Constructs a new HazeStyle instance with a single tint. This overload simplifies the creation of a HazeStyle when only one tint is needed. ```APIDOC ## HazeStyle Constructor with Single Tint ### Description Constructs a new HazeStyle instance with a single tint. This overload simplifies the creation of a HazeStyle when only one tint is needed. ### Parameters * **backgroundColor** (Color) - Optional - Color to draw behind the blurred content. Typically `MaterialTheme.colorScheme.surface` or similar. * **tint** (HazeTint?) - Optional - The HazeTint to apply to the blurred content. * **blurRadius** (Dp) - Optional - Radius of the blur. * **noiseFactor** (Float) - Optional - Amount of noise applied to the content, in the range `0f` to `1f`. Anything outside of that range will be clamped. * **fallbackTint** (HazeTint) - Optional - The HazeTint to use when Haze uses the fallback scrim functionality. When the fallback tint is used, the tints provided in tints are ignored. ``` -------------------------------- ### Implement foreground blurring Source: https://chrisbanes.github.io/haze/1.7.2/usage Apply blur directly to content without requiring a HazeState or hazeSource. ```kotlin @Composable fun HazeExample(modifier: Modifier = Modifier) { Box(modifier = modifier) { Foreground( modifier = Modifier // Note that we do NOT pass in a HazeState .hazeEffect { // Use all of the same features as above tints = // ... progressive = // ... } .fillMaxSize() ) } } ``` -------------------------------- ### HazeStyle Constructors Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-style/index.html Constructors for creating a HazeStyle object. ```APIDOC ## HazeStyle Constructor 1 ### Description Creates a HazeStyle with specified background color, a list of tints, blur radius, noise factor, and a fallback tint. ### Parameters #### Named Parameters - **backgroundColor** (Color) - Optional - Color to draw behind the blurred content. - **tints** (List) - Optional - The HazeTints to apply to the blurred content. - **blurRadius** (Dp) - Optional - Radius of the blur. - **noiseFactor** (Float) - Optional - Amount of noise applied to the content, in the range `0f` to `1f`. - **fallbackTint** (HazeTint) - Optional - The HazeTint to use when Haze uses the fallback scrim functionality. ## HazeStyle Constructor 2 ### Description Creates a HazeStyle with specified background color, a single tint, blur radius, noise factor, and a fallback tint. ### Parameters #### Named Parameters - **backgroundColor** (Color) - Optional - Color to draw behind the blurred content. - **tint** (HazeTint?) - Optional - The HazeTint to apply to the blurred content. - **blurRadius** (Dp) - Optional - Radius of the blur. - **noiseFactor** (Float) - Optional - Amount of noise applied to the content, in the range `0f` to `1f`. - **fallbackTint** (HazeTint) - Optional - The HazeTint to use when Haze uses the fallback scrim functionality. ``` -------------------------------- ### HazeInputScale Interface Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-input-scale Overview of the HazeInputScale sealed interface and its available implementations. ```APIDOC ## HazeInputScale ### Description A sealed interface used for `HazeEffectScope.inputScale`. It defines the scaling behavior for input processing. ### Implementations - **Auto**: Automatic input scaling. Haze determines the appropriate scale based on current settings. - **Fixed(val scale: Float)**: Uses a specific fixed scale factor. - **None**: No input scaling applied (equivalent to `Fixed(1.0f)`). ``` -------------------------------- ### HazeSourceNode Functions Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-source-node/index.html Details the functions available on the HazeSourceNode instance. ```APIDOC ## HazeSourceNode Functions ### Description Functions available on the HazeSourceNode class. ### Functions - **draw()**: Overrides the draw function for custom drawing. - **onAttach()**: Called when the node is attached. - **onDensityChange()**: Called when the density changes. - **onDetach()**: Called when the node is detached. - **onGloballyPositioned(coordinates: LayoutCoordinates)**: Called when the node's global position is determined. - **onLayoutDirectionChange()**: Called when the layout direction changes. - **onMeasureResultChanged()**: Called when the measure results change. - **onObservedReadsChanged()**: Called when observed reads change. - **onPlaced(coordinates: LayoutCoordinates)**: Called when the node is placed. - **onRemeasured(size: IntSize)**: Called when the node is remeasured. - **onReset()**: Called to reset the node. - **sideEffect(effect: () -> Unit)**: Executes a side effect. ``` -------------------------------- ### RadialGradient Constructor Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-radial-gradient/index.html Initializes a new RadialGradient instance with configurable easing, center position, and intensity parameters. ```APIDOC ## Constructor RadialGradient ### Description Creates a radial gradient effect for HazeProgressive. ### Parameters - **easing** (Easing) - Optional - The easing function to use. Defaults to EaseIn. - **center** (Offset) - Optional - Center position of the radial gradient circle. Defaults to Offset.Unspecified. - **centerIntensity** (Float) - Optional - The intensity of the haze effect at the center (0f to 1f). Defaults to 1.0f. - **radius** (Float) - Optional - Radius for the radial gradient. Defaults to Float.POSITIVE_INFINITY. - **radiusIntensity** (Float) - Optional - The intensity of the haze effect at the radius (0f to 1f). Defaults to 0.0f. ### Platform Support - **Skia backed platforms (iOS, Desktop, etc)**: Supported - **Android SDK Level 33+**: Supported - **Android SDK Level 31-32**: Falls back to a mask - **Android SDK Level < 31**: Falls back to a scrim ``` -------------------------------- ### FluentMaterials - acrylicBase Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a translucent material, suitable for the most translucent layer. ```APIDOC ## acrylicBase ### Description A HazeStyle which implements a translucent material used for the most translucent layer. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### FluentMaterials - acrylicBase Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a translucent material, suitable for the most translucent layer. ```APIDOC ## acrylicBase ### Description A HazeStyle which implements a translucent material used for the most translucent layer. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.acrylicBase() ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for acrylic base ``` ``` -------------------------------- ### Build Default Tint Color Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-defaults/index.html A default builder for the 'tint' color that transforms the provided color. ```kotlin fun tint(color: Color): HazeTint ``` -------------------------------- ### HazeMaterials Functions Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-haze-materials A collection of Composable functions to create HazeStyle objects with different material opacities. ```APIDOC ## HazeMaterials Functions ### Description Functions to build HazeStyles that implement material-like effects. These are marked as experimental. ### Parameters #### Parameters - **containerColor** (Color) - Optional - The color of the container, defaults to MaterialTheme.colorScheme.surface. ### Functions - **regular()**: Implements a somewhat opaque material. - **thick()**: Implements a mostly opaque material. - **thin()**: Implements a translucent material. - **ultraThick()**: Implements a nearly opaque material. - **ultraThin()**: Implements a mostly translucent material. ### Returns - **HazeStyle**: The configured style object. ``` -------------------------------- ### Companion Object Functions Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-companion/index.html This section details the functions available within the Companion object for creating HazeProgressive Brushes and gradients. ```APIDOC ## Companion Object Functions ### Description Provides utility functions for creating HazeProgressive Brushes and gradients. ### Functions #### `forShader` ##### Description Helper function for building a `HazeProgressive.Brush` with a `Shader`. The block is provided with the size of the content, allowing you to setup the shader as required. ##### Signature `inline fun forShader(crossinline block: (Size) -> Shader): HazeProgressive.Brush` #### `horizontalGradient` ##### Description A horizontal gradient effect. ##### Signature `fun horizontalGradient(easing: Easing = EaseIn, startX: Float = 0.0f, startIntensity: Float = 0.0f, endX: Float = Float.POSITIVE_INFINITY, endIntensity: Float = 1.0f, preferPerformance: Boolean = false): HazeProgressive.LinearGradient` ##### Parameters - **easing** (Easing) - Optional - Defaults to `EaseIn`. - **startX** (Float) - Optional - Defaults to `0.0f`. - **startIntensity** (Float) - Optional - Defaults to `0.0f`. - **endX** (Float) - Optional - Defaults to `Float.POSITIVE_INFINITY`. - **endIntensity** (Float) - Optional - Defaults to `1.0f`. - **preferPerformance** (Boolean) - Optional - Defaults to `false`. #### `verticalGradient` ##### Description A vertical gradient effect. ##### Signature `fun verticalGradient(easing: Easing = EaseIn, startY: Float = 0.0f, startIntensity: Float = 0.0f, endY: Float = Float.POSITIVE_INFINITY, endIntensity: Float = 1.0f, preferPerformance: Boolean = false): HazeProgressive.LinearGradient` ##### Parameters - **easing** (Easing) - Optional - Defaults to `EaseIn`. - **startY** (Float) - Optional - Defaults to `0.0f`. - **startIntensity** (Float) - Optional - Defaults to `0.0f`. - **endY** (Float) - Optional - Defaults to `Float.POSITIVE_INFINITY`. - **endIntensity** (Float) - Optional - Defaults to `1.0f`. - **preferPerformance** (Boolean) - Optional - Defaults to `false`. ``` -------------------------------- ### Companion Object Functions Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-companion This section details the functions available within the Companion object for creating HazeProgressive Brushes and gradients. ```APIDOC ## Companion Object Functions ### forShader #### Description Helper function for building a HazeProgressive.Brush with a Shader. The block is provided with the size of the content, allowing you to setup the shader as required. ### horizontalGradient #### Description A horizontal gradient effect. ### verticalGradient #### Description A vertical gradient effect. ``` -------------------------------- ### forShader Helper Function Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-progressive/-companion/for-shader.html Documentation for the forShader function used to build a HazeProgressive.Brush. ```APIDOC ## forShader ### Description Helper function for building a HazeProgressive.Brush with a Shader. The block is provided with the size of the content, allowing you to setup the shader as required. ### Method Kotlin Inline Function ### Parameters #### Parameters - **block** ((Size) -> Shader) - Required - A function that takes the content size and returns a Shader. ``` -------------------------------- ### Add Haze Materials Dependency Source: https://chrisbanes.github.io/haze/1.7.2/materials Add this to your module's build.gradle file to include Haze Materials. ```gradle repositories { mavenCentral() } dependencies { implementation("dev.chrisbanes.haze:haze-materials:") } ``` -------------------------------- ### Create a Thin HazeStyle Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-cupertino-materials/thin.html Use this composable to create a HazeStyle that implements a translucent material. It is more opaque than ultraThin but more translucent than regular HazeStyle. It defaults to the surface color of the MaterialTheme. ```kotlin @Composable @ReadOnlyComposable fun thin(containerColor: Color = MaterialTheme.colorScheme.surface): HazeStyle ``` -------------------------------- ### FluentMaterials - accentAcrylicBase Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a translucent material with an accent color, suitable for the most translucent layer. ```APIDOC ## accentAcrylicBase ### Description A HazeStyle which implements a translucent material used for the most translucent layer with accent color. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **accentColor** (Color) - Optional - Defaults to `MaterialTheme.colorScheme.primaryContainer`. - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.accentAcrylicBase(accentColor = Color.Blue) ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for accent acrylic base ``` ``` -------------------------------- ### FluentMaterials - accentAcrylicBase Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a translucent material with an accent color, suitable for the most translucent layer. ```APIDOC ## accentAcrylicBase ### Description A HazeStyle which implements a translucent material used for the most translucent layer with accent color. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **accentColor** (Color) - Optional - Defaults to `MaterialTheme.colorScheme.primaryContainer`. - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### CupertinoMaterials Functions Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-cupertino-materials/index.html Functions to create HazeStyles with varying levels of opacity and translucency based on iOS 18 design specifications. ```APIDOC ## Function: regular ### Description A HazeStyle which implements a somewhat opaque material. More opaque than thin, more translucent than thick. ### Parameters - **containerColor** (Color) - Optional - The background color to apply, defaults to MaterialTheme.colorScheme.surface. ## Function: thick ### Description A HazeStyle which implements a mostly opaque material. More opaque than regular. ### Parameters - **containerColor** (Color) - Optional - The background color to apply, defaults to MaterialTheme.colorScheme.surface. ## Function: thin ### Description A HazeStyle which implements a translucent material. More opaque than ultraThin, more translucent than regular. ### Parameters - **containerColor** (Color) - Optional - The background color to apply, defaults to MaterialTheme.colorScheme.surface. ## Function: ultraThin ### Description A HazeStyle which implements a mostly translucent material. ### Parameters - **containerColor** (Color) - Optional - The background color to apply, defaults to MaterialTheme.colorScheme.surface. ``` -------------------------------- ### Replace HazeDialog with standard Dialog Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-dialog.html Use the standard Dialog component from androidx.compose.ui.window instead of the deprecated HazeDialog. ```kotlin import androidx.compose.ui.window.Dialog ``` ```kotlin Dialog(onDismissRequest, properties, content) ``` -------------------------------- ### HazeDefaults Properties Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-defaults/index.html Overview of the default configuration properties available in HazeDefaults. ```APIDOC ## Properties - **blurRadius** (Dp) - Default blur radius. - **blurredEdgeTreatment** (BlurredEdgeTreatment) - Default value for HazeEffectScope.blurredEdgeTreatment. - **drawContentBehind** (Boolean) - Default value: false. - **noiseFactor** (Float) - Default value: 0.15f. - **tintAlpha** (Float) - Default alpha used for the tint color. ``` -------------------------------- ### HazeEffectScope Interface Reference Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-child-scope/index.html The name of the interface used for configuring haze effects. ```kotlin HazeEffectScope ``` -------------------------------- ### mica Composable Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/mica.html The mica function provides a HazeStyle implementation for translucent backgrounds. ```APIDOC ## mica ### Description A HazeStyle which implements a translucent application background material. ### Parameters #### Parameters - **isDark** (Boolean) - Optional - Determines if the style should be dark based on the surface luminance. Defaults to MaterialTheme.colorScheme.surface.luminance() < 0.5f. ### Returns - **HazeStyle** - The configured style for the application background. ``` -------------------------------- ### Configure SDK Level for Screenshot Tests Source: https://chrisbanes.github.io/haze/1.7.2/usage When running screenshot tests on Android with Robolectric, ensure your tests are configured to use SDK Level 35 or higher. This is necessary for Haze's blur effect to render correctly at the edges. ```kotlin @Config(sdk = [35]) ``` -------------------------------- ### Property: expandLayerBounds Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-effect-node/expand-layer-bounds.html Configuration for layer expansion behavior in Haze. ```APIDOC ## Property: expandLayerBounds ### Description Whether the layer should be expanded by the blurRadius on all edges. When enabled, it allows the blurred effect to be more consistent and realistic on the edges by capturing more nearby content. Defaults to enabled. ### Definition `open override var expandLayerBounds: Boolean?` ``` -------------------------------- ### Property: expandLayerBounds Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-effect-scope/expand-layer-bounds.html Configuration for layer expansion behavior in Haze. ```APIDOC ## Property: expandLayerBounds ### Description Whether the layer should be expanded by the blurRadius on all edges. Defaults to enabled. This allows the blurred effect to be more consistent and realistic on the edges by capturing more nearby content. Disable this if the blurred effect is drawn in unwanted areas. ### Type Boolean (Nullable) ### Default Value Enabled (true) ``` -------------------------------- ### FluentMaterials - accentAcrylicDefault Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials/index.html Creates a HazeStyle for a translucent material with an accent color, suitable for popup container backgrounds. ```APIDOC ## accentAcrylicDefault ### Description A HazeStyle which implements a translucent material used for the popup container background with accent color. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **accentColor** (Color) - Optional - Defaults to `MaterialTheme.colorScheme.primaryContainer`. - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ``` -------------------------------- ### FluentMaterials - accentAcrylicDefault Source: https://chrisbanes.github.io/haze/1.7.2/api/haze-materials/dev.chrisbanes.haze.materials/-fluent-materials Creates a HazeStyle for a translucent material with an accent color, suitable for popup container backgrounds. ```APIDOC ## accentAcrylicDefault ### Description A HazeStyle which implements a translucent material used for the popup container background with accent color. ### Method @Composable @ReadOnlyComposable ### Endpoint N/A (Composable function) ### Parameters - **accentColor** (Color) - Optional - Defaults to `MaterialTheme.colorScheme.primaryContainer`. - **isDark** (Boolean) - Optional - Defaults to `MaterialTheme.colorScheme.surface.luminance() < 0.5f`. ### Response - **HazeStyle** - The generated HazeStyle object. ### Request Example ```kotlin val myStyle = FluentMaterials.accentAcrylicDefault(isDark = true) ``` ### Response Example ```kotlin // Returns a HazeStyle object configured for accent acrylic default ``` ``` -------------------------------- ### Create Default HazeStyle Source: https://chrisbanes.github.io/haze/1.7.2/api/haze/dev.chrisbanes.haze/-haze-defaults/index.html Generates a default HazeStyle for use with Modifier.hazeSource. It accepts backgroundColor, tint, blurRadius, and noiseFactor as parameters. ```kotlin fun style( backgroundColor: Color, tint: HazeTint = tint(backgroundColor), blurRadius: Dp = this.blurRadius, noiseFactor: Float = this.noiseFactor): HazeStyle ```