Skip to content

Commit

Permalink
fix issues with hslaString and copying iro.Color instances
Browse files Browse the repository at this point in the history
fixes #194 and #193
  • Loading branch information
jaames committed Jul 5, 2021
1 parent 1825363 commit 22d2c0e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
### Changelog

#### 5.5.2

##### Fixes

- Fixed an issue where the alpha channel wasn't being copied over when creating a new iro.Color instance from the value of an old one (see https://github.com/jaames/iro.js/issues/193)
- Fixed an issue where the iro.Color hslaString attribute wasn't returning a hsla string (see https://github.com/jaames/iro.js/issues/194)

#### 5.5.1

##### Fixes
Expand Down
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IroBox } from './Box';
import { IroWheel } from './Wheel';
import { IroColorPicker } from './ColorPicker';
declare namespace iro {
const version = "5.5.1";
const version = "5.5.2";
type Color = IroColor;
const Color: typeof IroColor;
type ColorPicker = IroColorPicker;
Expand Down
9 changes: 5 additions & 4 deletions dist/iro.es.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* iro.js v5.5.1
* iro.js v5.5.2
* 2016-2021 James Daniel
* Licensed under MPL 2.0
* github.com/jaames/iro.js
Expand Down Expand Up @@ -157,7 +157,7 @@ function () {
}
} else if (typeof value === 'object') {
if (value instanceof IroColor) {
this.hsv = value.hsv;
this.hsva = value.hsva;
} else if ('r' in value && 'g' in value && 'b' in value) {
this.rgb = value;
} else if ('h' in value && 's' in value && 'v' in value) {
Expand Down Expand Up @@ -685,7 +685,7 @@ function () {
key: "hslaString",
get: function get() {
var hsla = this.hsla;
return "hsl(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")";
return "hsla(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")";
},
set: function set(value) {
this.hslString = value;
Expand Down Expand Up @@ -1283,6 +1283,7 @@ function IroHandle(props) {
var cx = radius;
var cy = radius;
return (h("svg", { className: ("IroHandle IroHandle--" + (props.index) + " " + (props.isActive ? 'IroHandle--isActive' : '')), style: {
'-webkit-tap-highlight-color': 'rgba(0, 0, 0, 0);',
transform: ("translate(" + (cssValue(props.x)) + ", " + (cssValue(props.y)) + ")"),
willChange: 'transform',
top: cssValue(-radius),
Expand Down Expand Up @@ -1760,7 +1761,7 @@ var IroColorPickerWidget = createWidget(IroColorPicker);

var iro;
(function (iro) {
iro.version = "5.5.1"; // replaced by @rollup/plugin-replace; see rollup.config.js
iro.version = "5.5.2"; // replaced by @rollup/plugin-replace; see rollup.config.js
iro.Color = IroColor;
iro.ColorPicker = IroColorPickerWidget;
var ui;
Expand Down
9 changes: 5 additions & 4 deletions dist/iro.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* iro.js v5.5.1
* iro.js v5.5.2
* 2016-2021 James Daniel
* Licensed under MPL 2.0
* github.com/jaames/iro.js
Expand Down Expand Up @@ -163,7 +163,7 @@
}
} else if (typeof value === 'object') {
if (value instanceof IroColor) {
this.hsv = value.hsv;
this.hsva = value.hsva;
} else if ('r' in value && 'g' in value && 'b' in value) {
this.rgb = value;
} else if ('h' in value && 's' in value && 'v' in value) {
Expand Down Expand Up @@ -691,7 +691,7 @@
key: "hslaString",
get: function get() {
var hsla = this.hsla;
return "hsl(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")";
return "hsla(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")";
},
set: function set(value) {
this.hslString = value;
Expand Down Expand Up @@ -1289,6 +1289,7 @@
var cx = radius;
var cy = radius;
return (h("svg", { className: ("IroHandle IroHandle--" + (props.index) + " " + (props.isActive ? 'IroHandle--isActive' : '')), style: {
'-webkit-tap-highlight-color': 'rgba(0, 0, 0, 0);',
transform: ("translate(" + (cssValue(props.x)) + ", " + (cssValue(props.y)) + ")"),
willChange: 'transform',
top: cssValue(-radius),
Expand Down Expand Up @@ -1766,7 +1767,7 @@

var iro;
(function (iro) {
iro.version = "5.5.1"; // replaced by @rollup/plugin-replace; see rollup.config.js
iro.version = "5.5.2"; // replaced by @rollup/plugin-replace; see rollup.config.js
iro.Color = IroColor;
iro.ColorPicker = IroColorPickerWidget;
var ui;
Expand Down
2 changes: 1 addition & 1 deletion dist/iro.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/iro.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions docs/.vuepress/theme/js/iro.es.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* iro.js v5.5.1
* iro.js v5.5.2
* 2016-2021 James Daniel
* Licensed under MPL 2.0
* github.com/jaames/iro.js
Expand Down Expand Up @@ -157,7 +157,7 @@ function () {
}
} else if (typeof value === 'object') {
if (value instanceof IroColor) {
this.hsv = value.hsv;
this.hsva = value.hsva;
} else if ('r' in value && 'g' in value && 'b' in value) {
this.rgb = value;
} else if ('h' in value && 's' in value && 'v' in value) {
Expand Down Expand Up @@ -685,7 +685,7 @@ function () {
key: "hslaString",
get: function get() {
var hsla = this.hsla;
return "hsl(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")";
return "hsla(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")";
},
set: function set(value) {
this.hslString = value;
Expand Down Expand Up @@ -1283,6 +1283,7 @@ function IroHandle(props) {
var cx = radius;
var cy = radius;
return (h("svg", { className: ("IroHandle IroHandle--" + (props.index) + " " + (props.isActive ? 'IroHandle--isActive' : '')), style: {
'-webkit-tap-highlight-color': 'rgba(0, 0, 0, 0);',
transform: ("translate(" + (cssValue(props.x)) + ", " + (cssValue(props.y)) + ")"),
willChange: 'transform',
top: cssValue(-radius),
Expand Down Expand Up @@ -1760,7 +1761,7 @@ var IroColorPickerWidget = createWidget(IroColorPicker);

var iro;
(function (iro) {
iro.version = "5.5.1"; // replaced by @rollup/plugin-replace; see rollup.config.js
iro.version = "5.5.2"; // replaced by @rollup/plugin-replace; see rollup.config.js
iro.Color = IroColor;
iro.ColorPicker = IroColorPickerWidget;
var ui;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@jaames/iro",
"version": "5.5.1",
"version": "5.5.2",
"description": "Modular, design-conscious color picker widget for JavaScript",
"module": "dist/iro.es.js",
"main": "dist/iro.js",
"types": "dist/index.d.ts",
"dependencies": {
"@irojs/iro-core": "^1.2.0",
"@irojs/iro-core": "^1.2.1",
"preact": "^10.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 22d2c0e

Please sign in to comment.