Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion js/colpick.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,13 @@ For usage and examples: colpick.com/plugin
//Sets a color as new and current (default)
setColor: function(col, setCurrent) {
setCurrent = (typeof setCurrent === "undefined") ? 1 : setCurrent;
if (typeof col == 'string') {
if ((typeof col == 'string') || (typeof col == 'number')) {
if (typeof col == 'number') {
col = col.toString();
if (col.length == 3) {
col = col+col;
}
}
col = hexToHsb(col);
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
col = rgbToHsb(col);
Expand Down