ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
165 stars 78 forks source link

Is there any option to customise height & width of picker. #182

Open Sachien opened 6 years ago

Sachien commented 6 years ago

I wonder if there is any easy way to pass height and width for picker dimension via options/any. Or "radius" when options.round = true.

brandonn1231 commented 5 years ago

@Sachien were you able to find a solution to this? I'm trying to edit the width of the picker as well, but whenever I try to manually do it via targeting the classes, the picker just repeats itself.

Sachien commented 5 years ago

@brandonn1231 Yes I could do this by modifying library code as below.

this.pickerDimensions = {
    width: 300, // affects height actually
    height: 400// affects width actually
};

// this.pickerDimensions.height is replaced with this.pickerDimensions.width and vice versa
this.sliderDimensions = {
    width: this.options.horizontal ? this.pickerDimensions.height : 20,
    height: this.options.horizontal ? 20 : this.pickerDimensions.width
};