Skip to content

Commit

Permalink
Update ColorBox.getAppliableColor() to support 3-HEX values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Comandeer committed May 18, 2021
1 parent 8feb7c4 commit a80b8c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/colorbutton/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,11 @@

getAppliableColor: function( color ) {
var initialValue = color.getInitialValue(),
isHexLike = initialValue.toLowerCase() === color.getHex().toLowerCase().substr( 1 );
isHexLike = initialValue.toLowerCase() ===
color.getHex( initialValue.length === 3 ).toLowerCase().substr( 1 ),
isShortHexLike = isHexLike && initialValue.length === 3;

return isHexLike ? color.getHex() : initialValue;
return isHexLike ? color.getHex( isShortHexLike ) : initialValue;
}
},

Expand Down

0 comments on commit a80b8c6

Please sign in to comment.