Skip to content

Commit 811f421

Browse files
committed
Add saturation option for round color picker
1 parent 89ee2ae commit 811f421

File tree

6 files changed

+259
-96
lines changed

6 files changed

+259
-96
lines changed

examples/01-simple.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ <h1>AngularJS Color Picker</h1>
3636
<select ng-model="options.hue" class="form-control" ng-options="option.value as option.label for option in boolOptions"></select>
3737
</div>
3838

39+
<div class="row">
40+
<label class="control-label">Saturation (saturation) - whether or not to display the saturation control</label>
41+
<select ng-model="options.saturation" class="form-control" ng-options="option.value as option.label for option in boolOptions"></select>
42+
</div>
43+
3944
<div class="row">
4045
<label class="control-label">Alpha (alpha) - whether or not to display the alpha control</label>
4146
<select ng-model="options.alpha" class="form-control" ng-options="option.value as option.label for option in boolOptions"></select>
@@ -162,7 +167,7 @@ <h1>AngularJS Color Picker</h1>
162167
<div class="row">
163168
<h2>HTML Options</h2>
164169
<label class="control-label">Color</label>
165-
<color-picker class='col-sm-1' ng-model="color2" options="{'format':'hex', 'placeholder': color, 'round': false}"></color-picker>
170+
<color-picker class='col-sm-1' ng-model="color2" options="{'format':'hex', 'placeholder': 'Hello', 'round': false}"></color-picker>
166171
</div>
167172

168173
<div class="row">

examples/app.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
angular
22
.module('app', ['color.picker'])
33
.config(function($provide) {
4-
// $provide.decorator('ColorPickerOptions', function($delegate) {
5-
// var options = angular.copy($delegate);
6-
// options.round = true;
7-
// options.alpha = false;
8-
// options.format = 'hex';
9-
// return options;
10-
// });
4+
$provide.decorator('ColorPickerOptions', function($delegate) {
5+
var options = angular.copy($delegate);
6+
// options.round = true;
7+
// options.saturation = true;
8+
options.format = 'hsl';
9+
return options;
10+
});
1111
})
1212
.controller('AppCtrl', function($scope) {
1313
$scope.formatOptions = [{label: 'HSL', value: 'hsl'}, {label: 'HSV', value: 'hsv'}, {label: 'RGB', value: 'rgb'}, {label: 'HEX', value: 'hex'}, {label: 'HEX8', value: 'hex8'}];

0 commit comments

Comments
 (0)