-
-
Save codingwithsara/2c689995e59083e6482e6a1bed2201d6 to your computer and use it in GitHub Desktop.
JavaScript RGB to HEX converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>RGB to HEX Converter</title> | |
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet"> | |
<style> | |
/* ここにCSSを書いていきます。 */ | |
</style> | |
<script> | |
// ここにJavaScriptを書いていきます。 | |
</script> | |
</head> | |
<body> | |
<div id="container"> | |
<table> | |
<tr> | |
<th>Red</th> | |
<th>Green</th> | |
<th>Blue</th> | |
</tr> | |
<tr> | |
<td><input type="range" min="0" max="255" value="255" id="r" onchange="changeRange()"></td> | |
<td><input type="range" min="0" max="255" value="255" id="g" onchange="changeRange()"></td> | |
<td><input type="range" min="0" max="255" value="255" id="b" onchange="changeRange()"></td> | |
</tr> | |
<tr> | |
<td id="r-label">255</td> | |
<td id="g-label">255</td> | |
<td id="b-label">255</td> | |
</tr> | |
</table> | |
<h1 id="hex-label">#ffffff</h1> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment