From 255ec76a40226f7e8448a2414961795f4cb87854 Mon Sep 17 00:00:00 2001 From: limeng Date: Wed, 17 Aug 2022 14:20:50 +0800 Subject: [PATCH] add colorFilter property of image component Signed-off-by: limeng --- .../reference/arkui-ts/ts-basic-components-image.md | 1 + zh-cn/application-dev/ui/ts-types.md | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md index 716cbd5594..151ef3e02a 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md @@ -52,6 +52,7 @@ Image(src: string | PixelMap | Resource) | sourceSize | {
width: number,
height: number
} | - | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。
> **说明:**
> PixelMap资源不支持该属性。 | | syncLoad8+ | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 | | copyOption9+ | [CopyOptions](#copyoptions) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 | +| colorFilter9+ | [ColorFilter](../../ui/ts-types.md) | - | 给图像设置颜色滤镜效果。 | ### ImageFit diff --git a/zh-cn/application-dev/ui/ts-types.md b/zh-cn/application-dev/ui/ts-types.md index 7fe41c4e11..ebbb98117f 100644 --- a/zh-cn/application-dev/ui/ts-types.md +++ b/zh-cn/application-dev/ui/ts-types.md @@ -98,6 +98,14 @@ | ---- | ---------------------------------------- | ---------------------------------------- | | Font | {
size?: Length;
weight?: FontWeight  \| number  \| string;
family?: string  \| Resource;
style?: FontStyle;
} | 设置文本样式:
size: 设置文本尺寸,Length为number类型时,使用fp单位。
weight: 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。
family: 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。
style: 设置文本的字体样式。 | + +## ColorFilter类型9+ + +| 名称 | 类型定义 | 描述 | +| ----------- | -------- | ----------------------------------------------------------- | +| ColorFilter | number[] | 用于描述颜色矩阵信息。
行优先矩阵,长度为20的浮点数组。 | + + ## CustomBuilder类型8+ 组件属性方法参数可使用CustomBuilder类型来自定义UI描述。 -- GitLab