📜  js 反转颜色 - Javascript 代码示例

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

代码示例1
const invertColor = (bg) => {
    bg=parseInt(Number(bg.replace('#', '0x')), 10)
  bg=~bg
  bg=bg>>>0
  bg=bg&0x00ffffff
  bg='#' + bg.toString(16).padStart(6, "0")
  
  return bg
}