Skip to content

conversion-library / hexRgbsToRgb

Function: hexRgbsToRgb()

ts
function hexRgbsToRgb(color: string): string

hexRgbsToRgb

version: v0.0.6+

Parameters

color: string

输入 #rgb / #rrggbb

Returns

string

返回 rgb(r, g, b)

Example

ts
hexRgbsToRgb('#fff')
// rgb(255, 255, 255)
hexRgbsToRgb('#3456')
// rgba(51,68,85,0.4)
hexRgbsToRgb('#33445566')
// rgba(51,68,85,0.4)

Defined in

lib/color-conversion/hexAndRgb.ts:186