色值转换rgb转Hex

rgbToHex(r, g, b){
    var hex = ((r<<16) | (g<<8) | b).toString(16);
    return "#" + new Array(Math.abs(hex.length-7)).join("0") + hex;
}

Copyright © 2020 Seven all right reserved,powered by Gitbook该文件修订时间: 2022-01-25 15:16:08

results matching ""

    No results matching ""