diff --git a/docs/assets/polished.js b/docs/assets/polished.js index 5abfb6df..08f34581 100644 --- a/docs/assets/polished.js +++ b/docs/assets/polished.js @@ -2007,10 +2007,10 @@ if (saturation === 0) { // achromatic return convert(lightness, lightness, lightness); - } // formular from https://en.wikipedia.org/wiki/HSL_and_HSV + } // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV - var huePrime = hue % 360 / 60; + var huePrime = (hue % 360 + 360) % 360 / 60; var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation; var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)); var red = 0; @@ -2674,8 +2674,8 @@ /** * Changes the hue of the color. Hue is a number between 0 to 360. The first - * argument for adjustHue is the amount of degrees the color is rotated along - * the color wheel. + * argument for adjustHue is the amount of degrees the color is rotated around + * the color wheel, always producing a positive hue value. * * @example * // Styles as object usage @@ -2701,7 +2701,7 @@ if (color === 'transparent') return color; var hslColor = parseToHsl(color); return toColorString(_extends({}, hslColor, { - hue: (hslColor.hue + parseFloat(degree)) % 360 + hue: hslColor.hue + parseFloat(degree) })); } // prettier-ignore diff --git a/docs/docs/index.html b/docs/docs/index.html index 6195ae34..be9e37d0 100644 --- a/docs/docs/index.html +++ b/docs/docs/index.html @@ -3074,8 +3074,8 @@

Changes the hue of the color. Hue is a number between 0 to 360. The first -argument for adjustHue is the amount of degrees the color is rotated along -the color wheel.

+argument for adjustHue is the amount of degrees the color is rotated around +the color wheel, always producing a positive hue value.

adjustHue(degree: (number | string), color: string): string
diff --git a/package.json b/package.json index 2fde07be..4d53aa88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polished", - "version": "3.3.0", + "version": "3.3.2", "description": "A lightweight toolset for writing styles in Javascript.", "license": "MIT", "author": "Brian Hough (https://polished.js.org)", diff --git a/src/color/adjustHue.js b/src/color/adjustHue.js index e99e71a4..14372a46 100644 --- a/src/color/adjustHue.js +++ b/src/color/adjustHue.js @@ -5,8 +5,8 @@ import curry from '../internalHelpers/_curry' /** * Changes the hue of the color. Hue is a number between 0 to 360. The first - * argument for adjustHue is the amount of degrees the color is rotated along - * the color wheel. + * argument for adjustHue is the amount of degrees the color is rotated around + * the color wheel, always producing a positive hue value. * * @example * // Styles as object usage