diff --git a/bootstrap-colorpickersliders.jquery.json b/bootstrap-colorpickersliders.jquery.json index c947d21..f9189e3 100644 --- a/bootstrap-colorpickersliders.jquery.json +++ b/bootstrap-colorpickersliders.jquery.json @@ -12,7 +12,7 @@ "widget", "colorchooser" ], - "version": "3.0.0", + "version": "3.0.1", "author": { "name": "István Ujj-Mészáros", "url": "https://github.com/istvan-ujjmeszaros" diff --git a/bower.json b/bower.json index 101025d..dc6c818 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "bootstrap-colorpickersliders", - "version": "3.0.0", + "version": "3.0.1", "homepage": "http://www.virtuosoft.eu/code/bootstrap-colorpickersliders/", "authors": [ { diff --git a/composer.json b/composer.json index 07d66a0..9659e1d 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.0", + "version": "3.0.1", "authors": [ { "name": "István Ujj-Mészáros", diff --git a/dist/bootstrap.colorpickersliders.css b/dist/bootstrap.colorpickersliders.css index f1d0069..fded98c 100644 --- a/dist/bootstrap.colorpickersliders.css +++ b/dist/bootstrap.colorpickersliders.css @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.0 + * Bootstrap Color Picker Sliders - v3.0.1 * * 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 e6e3132..6d3603b 100644 --- a/dist/bootstrap.colorpickersliders.js +++ b/dist/bootstrap.colorpickersliders.js @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.0 + * Bootstrap Color Picker Sliders - v3.0.1 * * 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/ @@ -1350,7 +1350,12 @@ switch (format) { case 'hex': - $element.val(color.tiny.toHexString()); + if (color.hsla.a < 1) { + $element.val(color.tiny.toRgbString()); + } + else { + $element.val(color.tiny.toHexString()); + } break; case 'hsl': $element.val(color.tiny.toHslString()); @@ -1493,7 +1498,12 @@ switch (settings.previewformat) { case 'hex': - colorstring = color.tiny.toHexString(); + if (color.hsla.a < 1) { + colorstring = color.tiny.toRgbString(); + } + else { + colorstring = color.tiny.toHexString(); + } break; case 'hsl': colorstring = color.tiny.toHslString(); diff --git a/dist/bootstrap.colorpickersliders.min.css b/dist/bootstrap.colorpickersliders.min.css index 58ecee8..72ad824 100644 --- a/dist/bootstrap.colorpickersliders.min.css +++ b/dist/bootstrap.colorpickersliders.min.css @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.0 + * Bootstrap Color Picker Sliders - v3.0.1 * * 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 76f8156..c435ff3 100644 --- a/dist/bootstrap.colorpickersliders.min.js +++ b/dist/bootstrap.colorpickersliders.min.js @@ -1,5 +1,5 @@ /* - * Bootstrap Color Picker Sliders - v3.0.0 + * Bootstrap Color Picker Sliders - v3.0.1 * * 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/ @@ -12,4 +12,4 @@ * * Using color math algorithms from EasyRGB Web site:/ * http://www.easyrgb.com/index.php?X=MATH */ -!function(a){"use strict";a.fn.ColorPickerSliders=function(b){return this.each(function(){function c(){"undefined"==typeof b&&(b={}),fb=a.extend({color:"hsl(342, 52%, 70%)",size:"default",placement:"auto",trigger:"focus",preventtouchkeyboardonshow:!0,title:"",hsvpanel:!1,sliders:!0,grouping:!0,swatches:["FFFFFF","C0C0C0","808080","000000","FF0000","800000","FFFF00","808000","00FF00","008000","00FFFF","008080","0000FF","000080","FF00FF","800080"],customswatches:"colorpickkersliders",connectedinput:!1,flat:!1,updateinterval:30,previewontriggerelement:!0,previewcontrasttreshold:15,previewformat:"rgb",erroneousciecolormarkers:!0,invalidcolorsopacity:1,finercierangeedges:!0,titleswatchesadd:"Add color to swatches",titleswatchesremove:"Remove color from swatches",titleswatchesreset:"Reset to default swatches",order:{},labels:{},onchange:function(){}},b),fb.order=b.hasOwnProperty("order")?a.extend({opacity:!1,hsl:!1,rgb:!1,cie:!1,preview:!1},b.order):{opacity:0,hsl:1,rgb:2,cie:3,preview:4},b.hasOwnProperty("labels")||(b.labels={}),fb.labels=a.extend({hslhue:"HSL-Hue",hslsaturation:"HSL-Saturation",hsllightness:"HSL-Lightness",rgbred:"RGB-Red",rgbgreen:"RGB-Green",rgbblue:"RGB-Blue",cielightness:"CIE-Lightness",ciechroma:"CIE-Chroma",ciehue:"CIE-hue",opacity:"Opacity",preview:"Preview"},b.labels)}function d(){kb||(kb=!0,pb=a.fn.ColorPickerSliders.detectWhichGradientIsSupported(),"filter"===pb&&(pb=!1),!pb&&a.fn.ColorPickerSliders.svgSupported()&&(pb="svg"),c(),fb.order.hasOwnProperty("preview")&&fb.order.preview!==!1||pb||(fb.order.preview=10),p(),f(),g(),P(),Q(),fb.flat&&o(),q())}function e(){n(),E(),O(),r()}function f(){mb?(yb.tiny=tinycolor(lb.val()),yb.tiny.isValid()||(yb.tiny=tinycolor(fb.color))):yb.tiny=tinycolor(fb.color),yb.hsla=yb.tiny.toHsl(),yb.rgba=yb.tiny.toRgb(),yb.hsv=yb.tiny.toHsv(),yb.cielch=a.fn.ColorPickerSliders.rgb2lch(yb.rgba)}function g(){fb.connectedinput&&(nb=fb.connectedinput instanceof jQuery?fb.connectedinput:a(fb.connectedinput))}function h(b,c){var d=tinycolor(b);return d.isValid()?(yb.tiny=d,yb.hsla=d.toHsl(),yb.rgba=d.toRgb(),yb.hsv=d.toHsv(),yb.cielch=a.fn.ColorPickerSliders.rgb2lch(yb.rgba),fb.flat||qb?(gb.removeClass("cp-unconvertible-cie-color"),O(c)):(c||Q(),P()),!0):!1}function i(a){if(!fb.flat){if(qb)return lb.popover("hide"),lb.popover("show"),void r();k(a),qb=!0}}function j(){qb=!1,l()}function k(b){if(!(hb instanceof jQuery)){switch("undefined"==typeof b&&(b=!1),hb=a('
').appendTo("body"),gb=a('
').appendTo(hb),gb.html(m()),fb.size){case"sm":gb.addClass("cp-container-sm");break;case"lg":gb.addClass("cp-container-lg")}e(),b||x(),lb.popover({html:!0,animation:!1,trigger:"manual",title:fb.title,placement:fb.placement,container:hb,content:function(){return gb}}),lb.popover("show")}}function l(){hb.remove(),hb=null,lb.popover("destroy")}function m(){var a=[],b="";if(fb.sliders&&(fb.order.opacity!==!1&&(a[fb.order.opacity]='
'+fb.labels.opacity+'
'),fb.order.hsl!==!1&&(a[fb.order.hsl]='
'+fb.labels.hslhue+'
'+fb.labels.hslsaturation+'
'+fb.labels.hsllightness+'
'),fb.order.rgb!==!1&&(a[fb.order.rgb]='
'+fb.labels.rgbred+'
'+fb.labels.rgbgreen+'
'+fb.labels.rgbblue+'
'),fb.order.cie!==!1&&(a[fb.order.cie]='
'+fb.labels.cielightness+'
'+fb.labels.ciechroma+'
'+fb.labels.ciehue+'
'),fb.order.preview!==!1&&(a[fb.order.preview]='
')),fb.grouping&&(b+=!!fb.hsvpanel+!!(fb.sliders&&a.length>0)+!!fb.swatches>1?'