From df1d9e5a7d24e28807e747dcf7feb9462c43d4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Ujj-M=C3=A9sz=C3=A1ros?= Date: Thu, 12 Apr 2018 03:55:59 +0200 Subject: [PATCH] More cleanup. --- bootstrap-colorpickersliders.jquery.json | 4 +- bower.json | 4 +- composer.json | 2 +- dist/bootstrap.colorpickersliders.css | 2 +- dist/bootstrap.colorpickersliders.js | 2 +- dist/bootstrap.colorpickersliders.min.js | 2 +- nocielch.html | 522 ----------------------- package-lock.json | 2 +- package.json | 15 +- 9 files changed, 13 insertions(+), 542 deletions(-) delete mode 100644 nocielch.html diff --git a/bootstrap-colorpickersliders.jquery.json b/bootstrap-colorpickersliders.jquery.json index f9189e3..d927118 100644 --- a/bootstrap-colorpickersliders.jquery.json +++ b/bootstrap-colorpickersliders.jquery.json @@ -12,7 +12,7 @@ "widget", "colorchooser" ], - "version": "3.0.1", + "version": "3.1.0", "author": { "name": "István Ujj-Mészáros", "url": "https://github.com/istvan-ujjmeszaros" @@ -30,4 +30,4 @@ "dependencies": { "jquery": ">=1.7" } -} \ No newline at end of file +} diff --git a/bower.json b/bower.json index dc6c818..971e0c5 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "bootstrap-colorpickersliders", - "version": "3.0.1", - "homepage": "http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/", + "version": "3.1.0", + "homepage": "https://www.virtuosoft.eu/code/bootstrap-colorpickersliders/", "authors": [ { "name": "István Ujj-Mészáros", diff --git a/composer.json b/composer.json index 9659e1d..8ff2eb4 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "description": "Bootstrap 3 optimized responsive color selector with HSV, HSL, RGB and CIE-Lch (which supports human perceived lightness) selectors and color swatches.", "homepage": "http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/", - "version": "3.0.1", + "version": "3.1.0", "authors": [ { "name": "István Ujj-Mészáros", diff --git a/dist/bootstrap.colorpickersliders.css b/dist/bootstrap.colorpickersliders.css index 047208b..84d7cf4 100644 --- a/dist/bootstrap.colorpickersliders.css +++ b/dist/bootstrap.colorpickersliders.css @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.1 + * Bootstrap Color Picker Sliders - v3.1.0 * * Bootstrap 3 optimized responsive color selector with HSV, HSL, RGB and CIE-Lch (which supports human perceived lightness) selectors and color swatches. * http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/ diff --git a/dist/bootstrap.colorpickersliders.js b/dist/bootstrap.colorpickersliders.js index aaea56a..1bc3282 100644 --- a/dist/bootstrap.colorpickersliders.js +++ b/dist/bootstrap.colorpickersliders.js @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.1 + * Bootstrap Color Picker Sliders - v3.1.0 * * Bootstrap 3 optimized responsive color selector with HSV, HSL, RGB and CIE-Lch (which supports human perceived lightness) selectors and color swatches. * http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/ diff --git a/dist/bootstrap.colorpickersliders.min.js b/dist/bootstrap.colorpickersliders.min.js index 48cb9e9..45fd5ef 100644 --- a/dist/bootstrap.colorpickersliders.min.js +++ b/dist/bootstrap.colorpickersliders.min.js @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.1 + * Bootstrap Color Picker Sliders - v3.1.0 * * Bootstrap 3 optimized responsive color selector with HSV, HSL, RGB and CIE-Lch (which supports human perceived lightness) selectors and color swatches. * http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/ diff --git a/nocielch.html b/nocielch.html deleted file mode 100644 index bb9ffb7..0000000 --- a/nocielch.html +++ /dev/null @@ -1,522 +0,0 @@ - - - - - Bootstrap Color Picker Sliders - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -

Bootstrap Color Picker Sliders

- - Github project page - Download - -
- -

- This plugin is based on jQuery Color Picker Sliders, which doesn't need Bootstrap to work.
-

- -

Examples

- -

Full featured popover (HSV panel, HSL and RGB sliders, color swatches)

- - This popovers shows all the features in a grouped manner, so the user can choose the preferred color picking method. - -
-
-
-
- - -
-
-
-
- - - -

HSV flat

- -
-
-
-
- -
-
-<div id="hsvflat"></div>
-<script>
-    $("#hsvflat").ColorPickerSliders({
-        color: "rgb(36, 170, 242)",
-        flat: true,
-        sliders: false,
-        swatches: false,
-        hsvpanel: true
-    });
-</script>
-          
- - -
-
- -

HSL sliders with customizable color swatches (flat rendering)

- -
-
-
-
- -
-
-<div id="hslflat"></div>
-<script>
-    $("#hslflat").ColorPickerSliders({
-        color: "rgb(36, 170, 242)",
-        flat: true,
-        order: {
-            hsl: 1,
-            preview: 2
-        }
-    });
-</script>
-          
- - -
-
- -

Different sizes and color sliders (in bootstrap popovers)

- -
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- -
-
-<input type="text" class="form-control" id="small" value="#adff2f">
-<input type="text" class="form-control" id="smallhsv" value="#2FB6FF">
-<input type="text" class="form-control" id="default" value="#7f7f7f">
-<input type="text" class="form-control" id="large" value="rgb(251, 167, 219)">
-<input type="text" class="form-control" id="swatchesonly">
-<input type="text" class="form-control" id="hslswatches" value="hsl(180, 50%, 50%)">
-<script>
-  $("input#small").ColorPickerSliders({
-    size: 'sm',
-    placement: 'right',
-    swatches: false,
-    order: {
-      hsl: 1
-    }
-  });
-  $("input#smallhsv").ColorPickerSliders({
-    size: 'sm',
-    placement: 'right',
-    swatches: false,
-    sliders: false,
-    hsvpanel: true
-  });
-  $("input#default").ColorPickerSliders({
-    placement: 'right',
-    swatches: false,
-    order: {
-      rgb: 1
-    }
-  });
-  $("input#large").ColorPickerSliders({
-    size: 'lg',
-    placement: 'right',
-    swatches: false,
-    order: {
-      hsl: 1
-    }
-  });
-  $("input#swatchesonly").ColorPickerSliders({
-    placement: 'right',
-    color: 'red',
-    swatches: ['red', 'green', 'blue'],
-    customswatches: false,
-    order: {}
-  });
-  $("input#hslswatches").ColorPickerSliders({
-    placement: 'right',
-    grouping: false,
-    order: {
-      hsl: 1,
-      opacity: 2
-    }
-  });
-</script>
-          
- - - -
-
- -

Using the onchange() event

- -
-
- -
-
-
-<button class="btn btn-default" id="bgcolor">Change body bg color</button>
-<script>
-        $("#bgcolor").ColorPickerSliders({
-            color: 'white',
-            previewontriggerelement: false,
-            title: 'Body background color',
-            order: {
-                rgb: 1,
-                preview: 2
-            },
-            onchange: function(container, color) {
-                var body = $('body');
-
-                body.css("background-color", color.tiny.toRgbString());
-
-                if (color.cielch.l < 60) {
-                    body.css("color", "white");
-                }
-                else {
-                    body.css("color", "black");
-                }
-            }
-        });
-</script>
-          
-
- -
- -

Full featured flat rendering

- -

This example shows the CIE Lch sliders which is designed to approximate human vision. It means that yellow and blue with the same CIE lightness are identical to humans (which is not the case with HSL where blue seems to be much darker than yellow with the same HSL lightness).

-

CIE Lch is a special color model where not all colors are reproducible in the physical world, so this plugin just lowers the chroma of these colors to be convertible to RGB. You can read more about it on Wikipedia.

- -
-
-
-
- -
-
-<div id="flat"></div>
-<script>
-    $("#flat").ColorPickerSliders({
-        flat: true,
-        invalidcolorsopacity: 0
-    });
-</script>
-          
- invalidcolorsopacity hiddens the colors from the CIE sliders whose can not be converted to RGB without lowering their chroma values. It is good for creating color schemas. - - -
-
- -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescription
colorThis is the initial color if there is no valid (any CSS formatted) color value on the connected input element. Can be in any format that Tiny Color supports.
size'sm': Small sized popover.
- 'default': Default popover size.
- 'large': Large popover.
placementPopover placement direction. Can be 'auto' | 'top' | 'left' | 'bottom' | 'right'.
- When 'auto' is specified, it will dynamically reorient the popover. For example, if placement is 'auto left', the tooltip will display to the left when possible, otherwise it will display right.
title'': Popover title.
hsvpanelfalse: Enable/disable HSV color selector panel.
sliderstrue: Enable/disable the sliders.
groupingtrue: Enable/disable grouping of the HSV panel, Sliders and Swatches section.
trigger'focus': The popover will be visible on focus or on click.
- 'manual': No auto trigger of popover on focus/click. Must trigger colorpickersliders.show and colorpickersliders.hide events to show/hide the popover.
flatfalse: The color picker is rendered in a popup, which is shown on focus of the connected element.
- true: The color picker is rendered right after the connected element, and is always visible.
previewformatThis is the color format on the preview slider (if visible). Can be rgb, hsl or hex. Note that hex format can not represent the opacity value.
swatchesarray: Array of CSS colors (can be CSS color names as well).
- false: The swatches are disabled.
customswatchesstring: Name of the custom swatches group. Color pickers with the same customswatches name share the same swatch colors, so if you add a new color to one of the color pickers, then all the color pickers swatches will be updated on the page which has the same customswatches name.
- false: The custom swatches are disabled, so only the predefined swatches can be used.
connectedinputselector or jQuery object: The connected input elements value will be automatically updated in sync with the color picker. The color format which the color is represented i the input can be set via the data-color-format property. It can be any of hex, hsl or rgb. If it is hex, then the opacity will be discarded.
updateintervalUpdate interval of the sliders while dragging (ms). The default is 30.
previewontriggerelementtrue: Preview of the color on the connected element's background.
- false: No preview on the connected element.
previewcontrasttreshold30: If previewontriggerelement is enabled, then if the lightness is below of this value, the element's text color will be white. Otherwise the text is black.
erroneousciecolormarkerstrue: Unconvertable CIE colors are marked with an exclamation mark on the CIE sliders level marker.
- false: No exclamation mark on the markers.
invalidcolorsopacity1: Opacity of the invalid (unconvertable) area of the CIE sliders.
finercierangeedgestrue: Sharper, more accurate edges of the valid CIE ranges on the sliders.
- false: Smoother edges of the valid CIE ranges on the sliders.
orderAn object which defines which sliders appear and in which order.
- Possible properties: opacity, hsl, rgb, cie, preview.
labelsAn object which defines the labels of the sliders.
- Possible properties: hslhue, hslsaturation, hsllightness, rgbred, rgbgreen, rgbblue, cielightness, ciechroma, ciehue, opacity, preview.
onchangefunction(container, color): This function is triggered when the color is changed with the sliders or via a connected input. The color parameter holds the actual color object in the following formats: rgb object, hsl object, cie lch object, Tiny Color object.
titleswatchesaddstring: Title of the add color to swatches button.
titleswatchesresetstring: Title of the reset swatches button.
- -

Events

-

- Example usage: $("#colorpicker").trigger("colorpickersliders.updateColor", "red")); -

- -

- The following events can be triggered on the element which the color picker is initialized on. -

- - - - - - - - - - - - - - - - - - - - - - -
EventDescription
colorpickersliders.updateColorfunction(newcolor): Sets a new color for the color picker.
colorpickersliders.showfunction(): Shows the popover.
colorpickersliders.hidefunction(): Hiddens the popover.
- -

Download

-

Download from github. Please report issues and suggestions to github's issue tracker or contact me on g+ or twitter!

- -
- diff --git a/package-lock.json b/package-lock.json index aa7364b..0a09b53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bootstrap-colorpickersliders", - "version": "3.0.1", + "version": "3.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e31b2bc..441a5f0 100644 --- a/package.json +++ b/package.json @@ -6,23 +6,16 @@ "name": "István Ujj-Mészáros", "url": "https://github.com/istvan-ujjmeszaros" }, + "license": "Apache-2.0", "main": "dist/bootstrap.colorpickersliders.js", "contributors": [ - { - "name": "imaguiraga", - "url": "https://github.com/imaguiraga" - }, - { - "name": "Balmasich", - "url": "https://github.com/balmasich" - } ], "repository": { "type": "git", - "url": "http://github.com/istvan-ujjmeszaros/bootstrap-colorpickersliders.git" + "url": "https://github.com/istvan-ujjmeszaros/bootstrap-colorpickersliders.git" }, - "homepage": "http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/", - "version": "3.0.1", + "homepage": "https://www.virtuosoft.eu/code/bootstrap-colorpickersliders/", + "version": "3.1.0", "devDependencies": { "grunt": "^1.0.2", "grunt-cli": "^1.2.0",