blockly > utils > 颜色 > 混合

utils.colour.blend() 函数

使用指定的因数指示第一种颜色的权重,将两种颜色混合在一起。

Signature:

export declare function blend(colour1: string, colour2: string, factor: number): string | null;

参数

参数 类型 说明
colour1 string 第一种颜色。
colour2 string 第二色。
系数 number 要为 colour1 指定 colour2 的粗细。值应在 [0, 1] 范围内。

返回

字符串 | null

以十六进制表示的组合颜色。