Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement wheelAngle and wheelDirection params for iro.ColorPicker #67

Merged
merged 4 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ var colorPicker = new iro.ColorPicker("#color-picker-container", {
| `handleSvg` | Custom handle SVG, used for [Custom Handles](https://iro.js.org/guide.html#custom-handles) | `null` |
| `handleOrigin` | Custom handle origin point, used for [Custom Handles](https://iro.js.org/guide.html#custom-handles). | `{x:0,y:0}` |
| `wheelLightness` | If set to `false`, the color wheel will not fade to black when the lightness decreases. | `true` |
| `wheelAngle` | Starting angle of the color wheel's hue gradient, measured in degrees. | `0` |
| `wheelDirection` | Direction of the color wheel's hue gradient, either `"clockwise"` or `"anticlockwise"` | `"anticlockwise"` |
| `sliderHeight` | Slider control height. By default this will be calculated automatically | `undefined` |
| `sliderMargin` | Distance between the wheel and the slider controls. | `12` |
| `display` | CSS display value for the color picker root element. | `"block"` |
Expand Down
33 changes: 26 additions & 7 deletions dist/iro.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/iro.es.js.map

Large diffs are not rendered by default.

33 changes: 26 additions & 7 deletions dist/iro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.

2 changes: 1 addition & 1 deletion dist/iro.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/.vuepress/theme/ColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default {
markerRadius: 8,
borderWidth: 2,
borderColor: "#fff",
wheelAngle: 120,
wheelDirection: "clockwise",
width: 260,
color: "#906bff",
css: {
Expand Down
33 changes: 26 additions & 7 deletions docs/.vuepress/theme/js/iro.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docs/colorPicker_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ If set to `false`, the color wheel will not fade to black when the lightness dec

**Default value**: `true`

### `wheelAngle`

Starting angle of the color wheel's hue gradient, measured in degrees.

**Default value**: `0`

### `wheelDirection`

Direction of the color wheel's hue gradient, either `"clockwise"` or `"anticlockwise"`.

**Default value**: `"anticlockwise"`

### `sliderHeight`

Slider height, measued in pixels.
Expand Down
2 changes: 2 additions & 0 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ var colorPicker = new iro.ColorPicker("#color-picker-container", {
| `handleSvg` | Custom handle SVG, used for [Custom Handles](#custom-handles) | `null` |
| `handleOrigin` | Custom handle origin point, used for [Custom Handles](#custom-handles). | `{x:0,y:0}` |
| `wheelLightness` | If set to `false`, the color wheel will not fade to black when the lightness decreases. | `true` |
| `wheelAngle` | Starting angle of the color wheel's hue gradient, measured in degrees. | `0` |
| `wheelDirection` | Direction of the color wheel's hue gradient, either `"clockwise"` or `"anticlockwise"` | `"anticlockwise"` |
| `sliderHeight` | Slider control height. By default this will be calculated automatically | `undefined` |
| `sliderMargin` | Distance between the wheel and the slider controls. | `12` |
| `display` | CSS display value for the color picker root element. | `"block"` |
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
borderWidth: 2,
padding: 8,
wheelLightness: true,
wheelAngle: 270,
wheelDirection: 'anticlockwise',
layout: [
{
component: iro.ui.Wheel,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jaames/iro",
"version": "4.3.3",
"version": "4.4.0",
"description": "An HSV color picker widget for JavaScript, with a modern SVG-based user interface",
"module": "dist/iro.es.js",
"main": "dist/iro.js",
Expand Down
2 changes: 2 additions & 0 deletions src/colorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ ColorPicker.defaultProps = {
borderWidth: 0,
display: 'block',
wheelLightness: true,
wheelAngle: 0,
wheelDirection: 'anticlockwise',
sliderHeight: null,
sliderMargin: 12,
padding: 6,
Expand Down
Loading