Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Empty value #87

Closed
samselikoff opened this issue Jun 12, 2014 · 3 comments
Closed

Empty value #87

samselikoff opened this issue Jun 12, 2014 · 3 comments
Labels
Milestone

Comments

@samselikoff
Copy link

When my colorpicker input is the empty string, the colorpicker fires a change event with an e.color value of {b: 0, h: 0, s: 0, a:1}.

Is it possible to distinguish this from black?

@itsjavi itsjavi added the bug label Jun 12, 2014
@samselikoff
Copy link
Author

It looks like the Color class has this as its default: https://github.com/mjolnic/bootstrap-colorpicker/blob/master/src/js/colorpicker-color.js#L184

We could work on this, unless there's still plans to incorporate Tiny Color (from #78). Thoughts?

@itsjavi
Copy link
Owner

itsjavi commented Jun 13, 2014

Yes, when you call setColor a color is always set even if it's an empty string, null or invalid color, then defaults to black. We could change this behaviour in the future by throwing exceptions, but I'm currently working in the next major version, that will integrate Tiny Color (as said in #78).

I'd rather center my efforts in that version because Tiny Color has a better color parser, but I'll try to fix all the opened issues with it.

Here's a prototype, the idea is using gradients instead of background images, so the colorpicker sizes will be more customizable.

captura de pantalla 2014-06-13 a la s 07 43 06

@itsjavi
Copy link
Owner

itsjavi commented Jun 14, 2014

Updated #88

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

No branches or pull requests

2 participants