📜  十六进制到 rgb 函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:50.147000             🧑  作者: Mango

代码示例5
function hex2RGB(hex){
        const r = parseInt(hex.substring(1, 3), 16);
        const g = parseInt(hex.substring(3, 5), 16);
        const b = parseInt(hex.substring(5, 7), 16);
        return `${r}, ${g}, ${b}`;
}