In this tutorial, I will tell you how to use bootstrap color picker in your form.
It's very easy to pick a color for your component using Bootstrap color picker.
Bootstrap color picker provide multiple formats to add color like hex,rgb etc.
There are so many jquery plugins are available for adding color picker but Bootstrap color picker provide responsive color selector that can be easily integrate into your website.
You can easily customize color picker as per your needs, mainly this is used in admin interface for allowing user or visitors to customize theme color.
You can get this plugin on GitHub website that is developed by mjoinic.
- <html lang="en">
- <head>
- <title>Bootstrap Color Picker Plugin Example</title>
- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
- <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.3.6/css/bootstrap-colorpicker.css" rel="stylesheet">
- <script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.3.6/js/bootstrap-colorpicker.js"></script>
- </head>
- <body>
- <div class="container">
- <h1>Bootstrap Color Picker Plugin Example</h1>
- <div id="cp2" class="input-group colorpicker-component">
- <input type="text" value="#00AABB" class="form-control" />
- <span class="input-group-addon"><i></i></span>
- </div>
- </div>
- <script type="text/javascript">
- $('#cp2').colorpicker();
- </script>
- </body>
- </html>