Skip to content

Home > sic-util > rgb_to_hex

rgb_to_hex() function

该函数将 RGB 颜色数组转换为十六进制颜色代码。

Signature:

typescript
rgb_to_hex: (rgb: RgbColor) => string

Parameters

Parameter

Type

Description

rgb

RgbColor

参数 rgb 应该是一个数字数组,表示 RGB 颜色模型中颜色的红色、绿色和蓝色值。

**Returns:**

string

十六进制颜色代码。

Released under the MIT License.