Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Force set call on initialization (in case initial color is black)

Fixes issue #23
  • Loading branch information...
commit 85cbe35055fa138be14d818fc77d1f73e9b873f3 1 parent c581892
@bgrins authored
Showing with 7 additions and 0 deletions.
  1. +1 −0  index.html
  2. +6 −0 spectrum.js
View
1  index.html
@@ -94,6 +94,7 @@ <h3 class='point'>input[type=color]</h3>
<form method="get">
<input type='color' name='color' />
<input type='color' name='color2' value='#3355cc' />
+ <input type='color' name='color3' value='#000000' />
<input type="submit" />
</form>
</div>
View
6 spectrum.js
@@ -254,6 +254,12 @@
if (!!initialColor) {
set(initialColor);
+
+ // In case color was black - update the preview UI and set the format
+ // since the set function will not run (default color is black).
+ updateUI();
+ currentPreferredFormat = preferredFormat || tinycolor(initialColor).format;
+
addColorToSelectionPalette(initialColor);
}
else {
Please sign in to comment.
Something went wrong with that request. Please try again.