Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

jQuery MiniColors Plugin

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

jQuery miniColors: A small color selector

Copyright 2012 Cory LaViska for A Beautiful Site, LLC. (

Dual licensed under the MIT / GPLv2 licenses



  1. Link to jQuery: <script type="text/javascript" src=""></script>
  2. Link to miniColors: <script type="text/javascript" src="jquery.miniColors.js"></script>
  3. Include miniColors stylesheet: <link type="text/css" rel="stylesheet" href="jquery.miniColors.css" />
  4. Apply $([selector]).miniColors() to one or more INPUT elements


  • disabled [true,false] - Disables the control on init
  • readonly [true,false] - Makes the control read-only on init
  • opacity [true, false] - Enables/disables the opacity slider

Specify options on creation:

    optionName: value,
    optionName: value,

Preset color:

<input type="text" name="color" value="#FFCC00" />

Preset color and opacity:

<input type="text" name="color" value="#FFCC00" data-opacity=".5" />


Methods are called using this syntax:

$([selector]).miniColors('methodName', [value]);

Available Methods

  • letterCase [uppercase|lowercase|null] - forces the hex value into upper or lowercase
  • disabled [true|false] - sets the disabled status
  • readonly [true|false] - sets the readonly status
  • opacity (none) - gets the opacity level (0-1)
  • opacity (0-1) - sets the opacity level
  • value (none) - gets the current value; guaranteed to return a valid hex color
  • value [hex value] - sets the control's value
  • destroy (none)


  • change(hex, rgb) - called when the color value changes
  • open(hex, rgb) - called when the color picker is opened
  • close(hex, rgb) - called when the color picker is hidden

  • In all callbacks, this refers to the original input element.

  • hex is the hex color code of the selected color
  • rgb is an object containing red, green, and blue values; if opacity is enabled, it will also contain an alpha value (rgb.a)


// Get hex color code on change
    change: function(hex, rgb) {

// Get RGBA values on change
    opacity: true,
    change: function(hex, rgba) {
        console.log('rgba(' + rgba.r + ', ' + rgba.g + ', ' + rgba.b + ', ' + rgba.a + ')');

Known Issues

  • IE7/8 do not show opacity in the trigger since it uses RGBA


Something went wrong with that request. Please try again.