itsjavi / bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
https://itsjavi.com/bootstrap-colorpicker/
MIT License
1.38k stars 367 forks source link

Feature request: hide/remove the alpha bar #208

Closed ahbox closed 7 years ago

ahbox commented 7 years ago

This may be the best color picker I've tried. But only one thing: I want to hide the alpha bar for some cases. Is it possible to add something like this in the options?

$('.sample-selector').colorpicker({ showAlphaBar: false });

Thanks,

h2ooooooo commented 7 years ago

You can make the bar disappear by using a format like hex:

$('input').colorpicker({ format: 'hex' });

Note that the part of the picker where the alpha bar was will still be empty. I expanded the hue part of my code to overlap this empty area:

.colorpicker .colorpicker-hue {
    width: 54px;
}
itsjavi commented 7 years ago

new option useAlpha has now been added in master, candidate to v3.0.0. It not only hides the alpha bar, but also disables the possibility to set an alpha channel in the input manually