{"size": 431, "ext": "js", "max_stars_repo_path": "js/script1.js", "max_stars_repo_name": "divyamkakkar24/Color-Flipper", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/script1.js", "max_issues_repo_name": "divyamkakkar24/Color-Flipper", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/script1.js", "max_forks_repo_name": "divyamkakkar24/Color-Flipper", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.3529411765, "max_line_length": 73, "alphanum_fraction": 0.7238979118}
//ColorFlipper-Simple

const colors = ["green", "red", "rgba(133,122,200)", "#f15025"];

document.querySelector('#change').addEventListener('click', changeColor);

function changeColor() {
	let rang = randomRang();
	document.querySelector('#new').textContent = rang;
	document.body.style.backgroundColor = rang;
}

function randomRang(){
	let randomIndex = Math.floor(Math.random() * colors.length);
	return colors[randomIndex];
}
