random color generate

agnusdei·2023년 8월 8일
0
  function generateRandomColor() {
    const r = Math.floor(Math.random() * 256); // 0 ~ 255
    const g = Math.floor(Math.random() * 256); // 0 ~ 255
    const b = Math.floor(Math.random() * 256); // 0 ~ 255
    return `rgb(${r},${g},${b})`;
  }

0개의 댓글