iro.js

Changelog

5.5.2

Fixes

5.5.1

Fixes

As a bonus, this also should make UI interactions a little less choppy

5.5.0

Additions
Additions

5.4.0

Wow, thanks for 800 stars! I’m taking this milestone as a motivator to start working on iro.js again!

This release just presents some internal refactoring around how iro.js draws its UI. Instead of SVG components are now comprised of regular HTML elements - aside from handles which will still be SVG for the foreseeable future.

I’m hoping that this refactor will pave the way for making the library truly responsive in the near future. It should also make it a lot smoother and less resource-heavy overall, since we can now use conical gradients and all that nice CSS stuff instead of the hacky SVG equivalents.

Watch this space! :)

5.3.2

Adds optional second activeColorIndex param to ColorPicker.setColors() (https://github.com/jaames/iro.js/issues/162) and fixes IE11 event issue (https://github.com/jaames/iro.js/issues/163).

5.3.1

Fixes https://github.com/jaames/iro.js/issues/145

5.3.0

Added optional boxHeight option for setting the height of the box component. Added id option for all components, which will get passed to the input:start, input:move and input:end event callbacks as a second param (see https://github.com/jaames/iro.js/issues/140). Also mitigated an issue related to kelvin temperatures under 2000 (see https://github.com/jaames/iro.js/issues/138).

5.2.3

Bumps iro-core version to fix server-side environment issues noted in https://github.com/jaames/iro.js/issues/131

5.2.2

Fixes https://github.com/jaames/iro.js/issues/129

5.2.1

Fixed an issue where the touchstart event wasn’t firing on certain touchscreen desktop PCs, see https://github.com/jaames/iro.js/issues/126

5.2.0

Added slider types for red, green and blue color channels! See https://github.com/jaames/iro.js/issues/78

5.1.10

Fixes issue with kelvin -> RGB conversion that resulted in the red channel overflowing the 0-255 range in certain cases, see https://github.com/jaames/iro.js/issues/124

5.1.9

Adds activeIndex option for Slider and Box components, for manually specifying which color to use in multi-color setups

var colorPicker = new iro.ColorPicker("#demoWheel", {
  layout: [
    // default slider, will reflect whichever color is currently active
    {
      component: iro.ui.Slider,
    },
    // this slider will always reflect the color at index 2
    {
      component: iro.ui.Slider,
      options: {
        activeIndex: 2,
      }
    },
  ]
});

5.1.8

Re-adds iro.version since it was accidentally omitted in 5.1.7

5.1.7

Fixes Typescript issues noted in #109

5.1.6

Fixes package.json to include Typescript typedef files in the NPM package

5.1.5

Additions

Added margin color picker option for setting the gap between individual components. sliderMargin will also work for now, but will be deprecated in a later version.

5.1.4

Internal improvements to prevent events causing infinite loops

5.1.3

Additions

5.1.2

Further tweaks to input handling so that interacting with handles is more predictable overall.

5.1.1

Tweaked input handling so that interacting with handles on a multi-color picker is more predictable.

5.0.0

Additions
Breaking changes

4.5.3

Fixes

4.5.2

Fixes

4.5.1

Fixes

4.5.0

Additions

Added a new param for iro.ColorPicker:

Color picker event callbacks this context is now set to the active color picker instance

See issue thread #71 for more information

4.4.0

Additions

Added two new params for iro.ColorPicker:

See issue thread #66 for more information

4.3.3

Fixes

Fixes an issue where the alpha component wasn’t being parsed correctly from rgba and hsla strings. For more info, see issue thread #2 on the iro-transparency-plugin repository.

4.3.2

Fixes

Somehow a line of code was missed when the new events API was merged, so the input:change event wasn’t actually firing (issue thread #64). This is now fixed.

4.3.1

Fixes

Fixes a few issues related to how color alpha/transparency was handled internally, which was causing problems with iro-transparency-plugin. Setting a color to a value without an alpha component (e.g hexString = "#fff") will now set the alpha value to 1, and the alpha component will no longer be undefined when using new iro.Color. For more info, see issue thread #2 on the iro-transparency-plugin repository.

4.3.0

Additions
Changes

The color:change event no longer fires with the initial color value, as this was catching a few people out.

If you need to reproduce previous behaviour, please make sure to listen for both color:init and color:change events with the same listener, like so:

colorPicker.on(['color:init', 'color:change'], function(color, change) {
  // do whatever
});

4.2.3

Fixes

Fixes a typo in the input:move event (was previously “input:mode”). Thanks @jbellue for the contribution!

4.2.2

Fixes

Makes sure that input:start fires before color:update and that input:end fires after color:update. See thread #59.

4.2.1

Fixes

Fixes color picker DOM event handling in IE11, issue thread #58.

4.2.0

(nice)

Adds support for hue and saturation sliders, documented here

4.1.0

Internal plugin API changes to allow for plugins to customise the slider type

4.0.0

iro.js version 4.0.0 is a major rewrite of the core library which aims to solve numerous long-standing issues. There are numerous changes and deprecations, so please check the migration guide before moving your project over. If needed, version 3.5.1 has been preserved in the v3 branch.

Additions
Breaking Changes

Color Picker

Safari Bugfix Note

To resolve an issue where Safari wasn’t rendering the color picker properly because of certain client-side routing libraries, it was previously recommended to call emit('history:statechange') on the color picker when navigating to new client-side routes. This has been deprecated in favour of the catch-all forceUpdate() color picker method.

Static Color Methods

Color Methods

Stylesheet API

3.5.1

Additions

3.5.0

This is more of a spring cleaning release, no changes / fixes that might affect the API have been made.

Changes

3.4.3

Fixes

3.4.2

Fixes

3.4.1

Fixes

3.4.0

Additions

3.3.0

iro is now available as an npm module.

3.2.2

Fixes

3.2.1

Additions

3.2.0

Additions

3.1.1

This version works around two bugs in Safari’s handling of SVG gradient URLs. The first issue is caused by the library being used in combination with the HTML <base> element, and the second is a similar issue that may arise when using a client-side routing library that uses the HTML5 history API to navigate between views. More details can be found in this issue thread.

Additions

3.1.0

Additions

3.0.0

Another major release, there are some breaking changes this time around, particularly for those still using remnants of the older v1 API like watch and unwatch. While I understand that this may be frustrating (and bad practice…) I felt that it was important to remove/change a number of things to make iro.js more pleasant to use. I’m pretty happy with the current API as it stands, so I think it can be considered “locked” from here on. \ o /

Note: The v1 branch where version 1.0.0 of the library was formerly preserved has been deleted; the current version of the library supports IE9+ so there was no reason to keep it around any longer.

Breaking Changes
Additions
Improvements

2.2.1

Improvements

2.2.0

Additions

2.1.0

Additions
Improvements

2.0.0

This version represents a major rewrite of the library, although there are no major API changes. Anything using the publicly documented 1.0.0 API should be fully compatible with ver 2.0.0 and above (but not vice versa) for the foreseeable future.

Note: version 1.0.0 of the library has been preserved in the v1 branch. Feel free to use it if you want IE 9 support, but note that I don’t intend to actively maintain it.

Additions
Improvements

1.0.0 - Initial version