<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
background-color: #ffffff;
}
</style>
</head>
<body id="test">
<input type="color" id="keveres" value="#7990EC">
<button type="button" onclick="change_1()">Változtat</button>
<div><input type="range" name="red" id="piros" min="0" max="255" value="255">Piros</div>
<div><input type="range" name="green" id="zold" min="0" max="255" value="100">Zöld</div>
<div><input type="range" name="blue" id="kek" min="0" max="255" value="100">Kék</div>
<div><button type="button" onclick="change_2()">Változtat_2</button></div>
<p id="piroskiir"></p>
<script>
function change_1(){
let szin = document.getElementById('keveres').value;
document.getElementById('test').style.backgroundColor = szin;
document.getElementById('piroskiir').innerHTML= szin;
}
function change_2(){
let r =parseInt(document.getElementById('piros').value);
let b =parseInt(document.getElementById('kek').value);
let g =parseInt(document.getElementById('zold').value);
console.log(r + "," + g + ","+b);
document.getElementById('test').style.backgroundColor = "rgb("+r+","+g+","+b+")";
}
</script>
</body>
</html>