bootstrap-colorpicker

WebJar for bootstrap-colorpicker

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-farbelous-bootstrap-colorpicker-
Last Version

Last Version

3.0.0-beta.1
Release Date

Release Date

Type

Type

jar
Description

Description

bootstrap-colorpicker
WebJar for bootstrap-colorpicker
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/farbelous/bootstrap-colorpicker

Download github-com-farbelous-bootstrap-colorpicker-

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-farbelous-bootstrap-colorpicker-/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-farbelous-bootstrap-colorpicker-</artifactId>
    <version>3.0.0-beta.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-farbelous-bootstrap-colorpicker-/
implementation 'org.webjars.npm:github-com-farbelous-bootstrap-colorpicker-:3.0.0-beta.1'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-farbelous-bootstrap-colorpicker-/
implementation ("org.webjars.npm:github-com-farbelous-bootstrap-colorpicker-:3.0.0-beta.1")
'org.webjars.npm:github-com-farbelous-bootstrap-colorpicker-:jar:3.0.0-beta.1'
<dependency org="org.webjars.npm" name="github-com-farbelous-bootstrap-colorpicker-" rev="3.0.0-beta.1">
  <artifact name="github-com-farbelous-bootstrap-colorpicker-" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-farbelous-bootstrap-colorpicker-', version='3.0.0-beta.1')
)
libraryDependencies += "org.webjars.npm" % "github-com-farbelous-bootstrap-colorpicker-" % "3.0.0-beta.1"
[org.webjars.npm/github-com-farbelous-bootstrap-colorpicker- "3.0.0-beta.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : jquery jar [2.1.0,)
org.webjars.npm : tinycolor2 jar [1.4.1,2)

Project Modules

There are no modules declared in this project.
Logo by @reallinfo

Bootstrap Colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap 4.

Build Status npm

Install

You can get the latest version in many different ways:

  • Downloading the tarball from npm the registry: https://registry.npmjs.org/bootstrap-colorpicker/-/bootstrap-colorpicker-3.2.0.tgz (you can change the version in the url to any released tag)
  • Cloning using Git: git clone https://github.com/itsjavi/bootstrap-colorpicker.git
  • Installing via NPM: npm install bootstrap-colorpicker
  • Installing via Yarn: yarn add bootstrap-colorpicker
  • Installing via Composer: composer require itsjavi/bootstrap-colorpicker

Note that the dist files are only distributed via the NPM and Yarn installations.

For the rest methods, you will need to generate the files initializing the project with yarn install and then building the code using npm run build.

Versions

Colorpicker version Compatible Bootstrap version Dependencies
v2.x
Documentation
Bootstrap 3 or 4
  • jQuery >= 1.10
  • Bootstrap CSS (input addon)
v3.x
Documentation
Bootstrap 4 or without Bootstrap
  • jQuery >= 2.1.0
  • Bootstrap CSS (input addon, popover)
  • Bootstrap JS Bundle (popover)

Note that the plugin may work without Bootstrap if your code is not using any of the mentioned Bootstrap dependencies.

Examples

With Bootstrap

The Bootstrap JS dependency is optional and it is mainly needed for the popover support. No Bootstrap CSS is required for the plugin to work.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link href="dist/css/bootstrap-colorpicker.css" rel="stylesheet">
</head>
<body>
  <div class="demo">
      <h1>Bootstrap Colorpicker Demo (with Bootstrap)</h1>
      <input id="demo-input" type="text" value="rgb(255, 128, 0)" />
  </div>
  <script src="//code.jquery.com/jquery-3.4.1.js"></script>
  <script src="//unpkg.com/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
  <script src="dist/js/bootstrap-colorpicker.js"></script>
  <script>
    $(function () {
      // Basic instantiation:
      $('#demo-input').colorpicker();
      
      // Example using an event, to change the color of the #demo div background:
      $('#demo-input').on('colorpickerChange', function(event) {
        $('#demo').css('background-color', event.color.toString());
      });
    });
  </script>
</body>

Without Bootstrap

To use the plugin without Bootstrap, the popover option should be set to false or null and, depending on your implementation, you will usually need to set inline to true and a container selector option.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link href="dist/css/bootstrap-colorpicker.css" rel="stylesheet">
</head>
<body>
  <div id="demo">
      <h1>Bootstrap Colorpicker Demo (without Bootstrap)</h1>
    <input type="text" value="rgb(255, 128, 0)" />
  </div>
  <script src="//code.jquery.com/jquery-3.4.1.js"></script>
  <script src="dist/js/bootstrap-colorpicker.js"></script>
  <script>
    $(function() {
      $('#demo').colorpicker({
        popover: false,
        inline: true,
        container: '#demo'
      });
    });
  </script>
</body>

Contributions

This project exists thanks to all the people who contribute.

Please read CONTRIBUTING before sending a pull request or issue.

License

The MIT License (MIT). Please see the License File for more information.

Credits

Written and maintained by Javi Aguilar and all other contributors.

Based on Stefan Petre's color picker (2013).

Thanks to JetBrains for supporting this project.

Versions

Version
3.0.0-beta.1