metafizzy / huebee

🐝 1-click color picker
https://huebee.buzz
403 stars 43 forks source link

Remove sidebar swatches #35

Open Nlaux opened 3 years ago

Nlaux commented 3 years ago

Hi,

First off, wanted to say thanks for this awesome color picker, it's really fantastic. I have a styling question / request though. I'm wondering if it's possible to either a) delete the white to black vertical swatches next to the main grouping of color swatches or b) move them so they line up with the main grouping of color swatches?

Currently no matter what you set the number of shades to, (5, 7, any thing else) the vertical white to black swatches will always have 2 more than the main group. This creates an ugly blank space under the main group of swatches and I'd like to tighten up that area of the picker.

I put together a really crappy mock-up to explain better what I'm talking about.

popup

Thanks! ~Nick

BuchyOne commented 2 years ago

Late, but same requirement from a client. Will add as an option, so default functionality is not lost:

Line 647

var grayCount = this.getGrayCount();
        for (i = 0; i < grayCount; i++) {
            var lum = 1 - i / (shades - 1); // last assigns zero luminance i.e. black
            var color = this.colorModer(0, 0, lum);
            var swatch = getSwatch(color);
            this.addSwatch(swatch, hues + 1, i);
        }
    };

proto.getGrayCount = function () {
        return this.options.shades ? this.options.shades : 0; // do not increment by 2
};