色值转换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该文件修订时间: 2024-06-18 14:12:49

results matching ""

    No results matching ""