Skip to content

Commit abe9ee2

Browse files
authored
Merge pull request #157 from enricodeleo/master
Support hex formats as per TinyColor apis
2 parents 8c99b3c + ccf782a commit abe9ee2

11 files changed

+62
-13
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## v3.3.0
4+
5+
#### Breaking Changes
6+
* `hex` and `hex8` formats are now returning the hex value without the hash `#` character.
7+
8+
#### New Features
9+
* Now supporting values with and without the `#` for both hex and hex8 formats.
10+
11+
#### Bug Fixes
12+
* None
13+
314
## v3.2.1
415

516
#### Breaking Changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ $scope.options = {
8585
restrictToFormat: [false, true],
8686
allowEmpty: [false, true],
8787
// color
88-
format: ['hsl', 'hsv', 'rgb', 'hex', 'hex8', 'raw'],
88+
format: ['hsl', 'hsv', 'rgb', 'hex', 'hexString', 'hex8', 'hex8String', 'raw'],
8989
hue: [true, false],
9090
saturation: [false, true],
9191
lightness: [false, true], // Note: In the square mode this is HSV and in round mode this is HSL

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-color-picker",
33
"description": "Color Picker Directive For AngularJS",
4-
"version": "3.2.1",
4+
"version": "3.3.0",
55
"homepage": "https://github.com/ruhley/angular-color-picker",
66
"repository": {
77
"type": "git",

dist/angularjs-color-picker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2017 ruhley
66
*
7-
* 2017-03-23 08:33:58
7+
* 2017-05-15 02:14:57
88
*
99
*/
1010
.color-picker-wrapper {

dist/angularjs-color-picker.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2017 ruhley
66
*
7-
* 2017-03-23 08:33:55
7+
* 2017-05-15 02:14:55
88
*
99
*/
1010

@@ -19,13 +19,19 @@ tinycolor = 'default' in tinycolor ? tinycolor['default'] : tinycolor;
1919
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
2020
return typeof obj;
2121
} : function (obj) {
22-
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
22+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2323
};
2424

2525

2626

2727

2828

29+
30+
31+
32+
33+
34+
2935
var classCallCheck = function (instance, Constructor) {
3036
if (!(instance instanceof Constructor)) {
3137
throw new TypeError("Cannot call a class as a function");
@@ -607,14 +613,30 @@ var AngularColorPickerController = function () {
607613
break;
608614

609615
case 'hex':
616+
if (this.options.case === 'lower') {
617+
this.ngModel = color.toHex().toLowerCase();
618+
} else {
619+
this.ngModel = color.toHex().toUpperCase();
620+
}
621+
break;
622+
623+
case 'hex8':
624+
if (this.options.case === 'lower') {
625+
this.ngModel = color.toHex8().toLowerCase();
626+
} else {
627+
this.ngModel = color.toHex8().toUpperCase();
628+
}
629+
break;
630+
631+
case 'hexString':
610632
if (this.options.case === 'lower') {
611633
this.ngModel = color.toHexString().toLowerCase();
612634
} else {
613635
this.ngModel = color.toHexString().toUpperCase();
614636
}
615637
break;
616638

617-
case 'hex8':
639+
case 'hex8String':
618640
if (this.options.case === 'lower') {
619641
this.ngModel = color.toHex8String().toLowerCase();
620642
} else {

dist/angularjs-color-picker.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angularjs-color-picker.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/themes/angularjs-color-picker-bootstrap.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2017 ruhley
66
*
7-
* 2017-03-23 08:33:58
7+
* 2017-05-15 02:14:57
88
*
99
*/
1010
.color-picker-wrapper .color-picker-input-wrapper {

dist/themes/angularjs-color-picker-bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
*
55
* Copyright 2017 ruhley
66
*
7-
* 2017-03-23 08:33:58
7+
* 2017-05-15 02:14:57
88
*
99
*/.color-picker-wrapper .color-picker-input-wrapper{width:100%}.color-picker-wrapper .color-picker-swatch:not(.input-group-addon){height:28px}.color-picker-wrapper.color-picker-swatch-only .input-group .input-group-addon{border-radius:4px}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angularjs-color-picker",
33
"description": "Color Picker Directive For AngularJS",
4-
"version": "3.2.1",
4+
"version": "3.3.0",
55
"license": "MIT",
66
"main": "dist/angularjs-color-picker.min.js",
77
"dependencies": {

0 commit comments

Comments
 (0)