hex_btn-2

1.0.0 • Public • Published

What is this?

This is randomColor for change background

Installation

npm install hex_btn-2

Using...

import { renderHexes } from "nex_btn-2";
function renderHexes() {
  let temp = "0123456789ABCDEF";
  let color = "#";
  for (let i = 0; i < 6; i++) {
    color += temp[Math.floor(Math.random() * 16)];
  }
  return color;
}

allBtn.forEach((index) => {
  let color = renderHexes();
  index.style.backgroundColor = color;
  index.innerHTML = color;
  index.addEventListener("click", () => {
    document.body.style.backgroundColor = color;
  });
});

Readme

Keywords

Package Sidebar

Install

npm i hex_btn-2

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.6 kB

Total Files

3

Last publish

Collaborators

  • azizov97