diff --git a/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Average_Color.png b/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Average_Color.png new file mode 100644 index 0000000000000000000000000000000000000000..db2d6dca8a84f09b59aaa1affb5caf5deb289669 Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Average_Color.png differ diff --git a/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Highest_Saturation_Color.png b/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Highest_Saturation_Color.png new file mode 100644 index 0000000000000000000000000000000000000000..6bf7c7ba71bee89b092cdf9a8e6a5e786b8e389b Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Highest_Saturation_Color.png differ diff --git a/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Largest_Proportion_Color.png b/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Largest_Proportion_Color.png new file mode 100644 index 0000000000000000000000000000000000000000..93f347b1abf77970d9f84569423f0ea1673ecf9a Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-ch_image_Largest_Proportion_Color.png differ diff --git a/zh-cn/application-dev/reference/apis/js-apis-effectKit.md b/zh-cn/application-dev/reference/apis/js-apis-effectKit.md index 5610c212819c32fc322225e6824da36fbc87a736..19e128c424c2554cf11544241c51389277e0bcdc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-effectKit.md +++ b/zh-cn/application-dev/reference/apis/js-apis-effectKit.md @@ -180,6 +180,93 @@ console.log('get main color =' + color); ``` ![zh-ch_image_Main_Color.png](figures/zh-ch_image_Main_Color.png) +### getLargestProportionColor10+ + +getLargestProportionColor(): Color + +读取图像占比最多的颜色值,结果写入[Color](#color)里,使用同步方式返回。 + +**系统能力:** SystemCapability.Multimedia.Image.Core + +**返回值:** + +| 类型 | 说明 | +| :------------- | :---------------------------------------------- | +| [Color](#color) | Color实例,即图像占比最多的颜色值,失败时返回null。 | + +**示例:** + +```js +let color = colorPicker.getLargestProportionColor(); +console.log('get largest proportion color =' + color); +``` +![zh-ch_image_Largest_Proportion_Color.png](figures/zh-ch_image_Largest_Proportion_Color.png) + +### getHighestSaturationColor10+ + +getHighestSaturationColor(): Color + +读取图像饱和度最高的颜色值,结果写入[Color](#color)里,使用同步方式返回。 + +**系统能力:** SystemCapability.Multimedia.Image.Core + +**返回值:** + +| 类型 | 说明 | +| :------------- | :---------------------------------------------- | +| [Color](#color) | Color实例,即图像饱和度最高的颜色值,失败时返回null。 | + +**示例:** + +```js +let color = colorPicker.getHighestSaturationColor(); +console.log('get highest saturation color =' + color); +``` +![zh-ch_image_Highest_Saturation_Color.png](figures/zh-ch_image_Highest_Saturation_Color.png) + +### getAverageColor10+ + +getAverageColor(): Color + +读取图像平均的颜色值,结果写入[Color](#color)里,使用同步方式返回。 + +**系统能力:** SystemCapability.Multimedia.Image.Core + +**返回值:** + +| 类型 | 说明 | +| :------------- | :---------------------------------------------- | +| [Color](#color) | Color实例,即图像平均的颜色值,失败时返回null。 | + +**示例:** + +```js +let color = colorPicker.getAverageColor(); +console.log('get average color =' + color); +``` +![zh-ch_image_Average_Color.png](figures/zh-ch_image_Average_Color.png) + +### isBlackOrWhiteOrGrayColor10+ + +isBlackOrWhiteOrGrayColor(color: number): boolean + +判断图像是否为黑白灰颜色,返回true或false。 + +**系统能力:** SystemCapability.Multimedia.Image.Core + +**返回值:** + +| 类型 | 说明 | +| :------------- | :---------------------------------------------- | +| boolean | 如果此图像为黑白灰颜色,则返回true;否则返回false。 | + +**示例:** + +```js +let bJudge = colorPicker.isBlackOrWhiteOrGrayColor(0xFFFFFFFF); +console.log('is black or white or gray color[bool](white) =' + bJudge); +``` + ## Filter 图像效果类,用于将指定的效果添加到输入图像中。在调用Filter的方法前,需要先通过[createEffect](#effectkitcreateeffect)创建一个Filter实例。