色值转换Hex转rgb

hexToRgb(hex){
    var rgb = [];
    for(var i=0; i<6; i+=2){
        rgb.push(parseInt("0x" + hex.slice(i,i+2)));
        // rgb.push(parseInt(hex.slice(i,i+2),16))
    }
    return rgb;
}

Copyright © 2020 Seven all right reserved,powered by Gitbook该文件修订时间: 2022-09-06 10:22:43

results matching ""

    No results matching ""