chore: replace deprecated String.prototype.substr()

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
Tobias Speicher 2022-03-19 02:29:57 +01:00 committed by Labhansh Agrawal
parent 968ecf8794
commit b7ff279837

View file

@ -13,5 +13,5 @@ export default (bgColor: string) => {
// http://stackoverflow.com/a/11019879/1202488
const alphaHex = Math.round(color.alpha() * 255).toString(16);
return `#${alphaHex}${color.hex().toString().substr(1)}`;
return `#${alphaHex}${color.hex().toString().slice(1)}`;
};