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

Remove sidebar swatches #35

Open
Nlaux opened this issue Jun 29, 2021 · 1 comment
Open

Remove sidebar swatches #35

Nlaux opened this issue Jun 29, 2021 · 1 comment

Comments

@Nlaux
Copy link

Nlaux commented Jun 29, 2021

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
Copy link

BuchyOne commented Mar 7, 2022

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
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants