1e41f4b71Sopenharmony_ci# Foreground Blur
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciYou can apply foreground blur effects to a component.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci>  **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci>  This attribute is supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## foregroundBlurStyle
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciforegroundBlurStyle(value: BlurStyle, options?: ForegroundBlurStyleOptions)
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciApplies a foreground blur style to the component.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci**Parameters**
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci| Name | Type                                                        | Mandatory| Description                                                        |
22e41f4b71Sopenharmony_ci| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
23e41f4b71Sopenharmony_ci| value   | [BlurStyle](ts-universal-attributes-background.md#blurstyle9)                 | Yes  | Settings of the foreground blur style,|
24e41f4b71Sopenharmony_ci| options | [ForegroundBlurStyleOptions](#foregroundblurstyleoptions) | No  | Foreground blur options.                                    |
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci## ForegroundBlurStyleOptions
27e41f4b71Sopenharmony_ciInherited from [BlurStyleOptions](#blurstyleoptions).
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12.
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci## BlurStyleOptions
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci| Name                       | Type                                               | Mandatory| Description                                                        |
34e41f4b71Sopenharmony_ci| --------------------------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
35e41f4b71Sopenharmony_ci| colorMode     | [ThemeColorMode](ts-appendix-enums.md#themecolormode10) | No  | Color mode used for the foreground blur.<br>Default value: **ThemeColorMode.System**<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
36e41f4b71Sopenharmony_ci| adaptiveColor | [AdaptiveColor](#adaptivecolor10)   | No  | Adaptive color mode.<br>Default value: **AdaptiveColor.Default**<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
37e41f4b71Sopenharmony_ci| blurOptions<sup>11+</sup> | [BlurOptions](#bluroptions11)         | No   | Grayscale blur parameters.<br>Default value: **grayScale: [0,0]**<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
38e41f4b71Sopenharmony_ci| scale<sup>12+</sup> | number   | No  | Foreground blur scale.<br>Default value: **1.0**<br>Value range: [0.0, 1.0]<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci## AdaptiveColor<sup>10+</sup>
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci| Name     | Description                       |
47e41f4b71Sopenharmony_ci| ------- | ------------------------- |
48e41f4b71Sopenharmony_ci| DEFAULT | Adaptive color mode is not used. The default color is used as the mask color. Using a mode other than **DEFAULT** can be more time-consuming.   |
49e41f4b71Sopenharmony_ci| AVERAGE | Adaptive color mode is used. The average color value of the color picking area is used as the mask color.|
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci## BlurOptions<sup>11+</sup>
52e41f4b71Sopenharmony_ciGrayscale blur parameters.
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12.
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci| Name       |   Type  |   Mandatory| Description                       |
59e41f4b71Sopenharmony_ci| ----        |  ----   |   ---- | --------------------------  |
60e41f4b71Sopenharmony_ci| grayscale   |  [number, number]   |   Yes  |  Grayscale blur, with two parameters in the value range of [0, 127]. The color gradation of the black and white in the image is adjusted to create different shades of gray. The first parameter indicates the brightness of the black color, and the second parameter indicates the darkness of the white color. A larger value indicates a more obvious adjustment effect (the black and white colors become grayer). For example, if the value specified is (20,20), the RGB value [0, 0, 0] (black) is converted to [20, 20, 20], RGB value [255, 255, 255] (white) is converted to [235, 235, 235] (255-20), and the color pixels remain unchanged.|
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ci
63e41f4b71Sopenharmony_ci## Example
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ci```ts
66e41f4b71Sopenharmony_ci// xxx.ets
67e41f4b71Sopenharmony_ci@Entry
68e41f4b71Sopenharmony_ci@Component
69e41f4b71Sopenharmony_cistruct ForegroundBlurStyleDemo {
70e41f4b71Sopenharmony_ci  build() {
71e41f4b71Sopenharmony_ci    Column() {
72e41f4b71Sopenharmony_ci      Text('Thin Material').fontSize(30).fontColor(0xCCCCCC)
73e41f4b71Sopenharmony_ci      Image($r('app.media.bg'))
74e41f4b71Sopenharmony_ci        .width(300)
75e41f4b71Sopenharmony_ci        .height(350)
76e41f4b71Sopenharmony_ci        .foregroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
77e41f4b71Sopenharmony_ci    }
78e41f4b71Sopenharmony_ci    .height('100%')
79e41f4b71Sopenharmony_ci    .width('100%')
80e41f4b71Sopenharmony_ci  }
81e41f4b71Sopenharmony_ci}
82e41f4b71Sopenharmony_ci```
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci![en-us_image_background_blur_style](figures/en-us_image_foreground_blur_style.png)
85