• This repository has been archived on 08/Apr/2022
  • Stars
    star
    1,381
  • Rank 33,830 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.

Bootstrap Colorpicker

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

Build Status npm

THIS PROJECT IS NOT MAINTAINED ANYMORE. After almost 10 years, it won't receive any further update. I recommend you using more modern solutions like React Color. You are still free to adapt this project and create forks and variants of it.

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.4.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.

More Repositories

1

fontawesome-iconpicker

Font Awesome Icon Picker component for Bootstrap.
JavaScript
560
star
2

newbark-unity

🌳 A proof-of-concept Pokémon-style Retro RPG game framework created with Unity 🔥🌿💧⚡️
C#
155
star
3

pokemon-assets

The ultimate compilation of Pokémon data and assets: menu sprites, glyphs and icons, CSS spritesheets, all data in JSON format, fonts, sounds, etc.
CSS
58
star
4

swordshield-data

⚔️🛡Pokémon Sword and Shield Data Dump parser in optimised JSON format. (Includes DLCs data).
PHP
43
star
5

autotiler

Autotile 47-tile blob tileset generator application with Godot export support. Based on Electron JS.
JavaScript
39
star
6

jsx-runtime

Extremely lightweight JSX runtime (<3KB) to write JSX without React in TypeScript or JavaScript.
TypeScript
33
star
7

livingdex

Living Dex is a Pokédex and a visual guide that helps you organizing all storable Pokémon forms and variants in Pokémon HOME boxes.
JavaScript
23
star
8

supereffective-assets

Pokémon data and assets used in SuperEffective.gg
TypeScript
19
star
9

mediatidy

🗂 Command-line tool to organize large directories of media files recursively by date, detecting duplicates.
Go
19
star
10

turborepo-react-next

Starter template monorepo with TS, ReactJS, NextJS, Prisma, TailwindCSS, NextAuth and Vitest
TypeScript
15
star
11

koffing

Online Pokémon Showdown Team parser that converts your competitive strategies to machine-readable JSON code.
TypeScript
13
star
12

supereffective

The most complete Pokémon tracker
TypeScript
8
star
13

supereffective-issues

Issue Tracker and Task Board for supereffective.gg
5
star
14

turborepo-solid-astro

Starter template repo with Turborepo + SolidJS + Astro + MDX + TypeScript support.
Astro
5
star
15

spritesheet-generator

Generates CSS, SCSS and a sprite sheet image from a directory of PNGs, using the power of Bash and ImageMagick
Shell
4
star
16

livingdex-data

Pokémon data normalisation tool, with periodically updated data from: Showdown, Veekun DB & POGOProtos.
PHP
3
star
17

ra-admin-guesser-treeql

🪄 React Admin data provider and UI scaffolder for TreeQL-powered REST APIs like PHP-CRUD-API. An automatic admin UI for your SQL databases.
TypeScript
3
star
18

newbark-gamemaker

🌳 A proof-of-concept Pokémon-style Retro RPG engine created with GameMaker 🔥🌿💧⚡️
Yacc
2
star
19

SymfonyDoctrineAppTemplate

Dockerized development environment for new Symfony (LTS) apps that use Doctrine.
PHP
1
star
20

node-gh-pages-deploy

Node script for publishing a directory into the project's gh-pages branch.
JavaScript
1
star
21

next-mdx-frontmatter

Custom @next/mdx with FrontMatter and page layouts support. Next.js + MDX + FrontMatter.
JavaScript
1
star
22

storylite

A lightweight alternative to StoryBook, built on top of Vite⚡️
TypeScript
1
star
23

movies-recommender

Simple Movie Recommender system in Python using Pandas, Sklearn and Streamlit
Jupyter Notebook
1
star
24

tidymypics

Image Classifier and Photo Library Organizer using Python and Tensorflow
Python
1
star
25

devv

📦 Containerize your local development environment without writing a line of Docker configuration. PHP, Node, Go & more
Dockerfile
1
star