A simple web application that lets you pick a color using a color picker and instantly generates its HEX color code. This code can be used to style your HTML elements.
- Open
index.html
in your web browser. - Use the color picker to select a color.
- The HEX code will be displayed, and the page background will change accordingly.
- Color Picker
- Display of HEX Code
- Background Color Change
- HTML
- CSS
- JavaScript
- HTML structure:
- Title, metadata, and styles in
<head>
. - Content in
<body>
:- Title
<h1>
. - Color picker and HEX code display in a styled
<div>
.
- Title
- Title, metadata, and styles in
- CSS is used for layout and design.
- Styles include centered layout and color picker styling.
- JavaScript:
- Selects color picker and HEX code display elements.
- Initializes the color picker with black.
- Updates HEX code and background color when a new color is picked.
Works in modern browsers supporting HTML5, CSS3, and JavaScript. Ensure your browser is up to date.
Feel free to use and modify this code for your projects. Happy coding!