From a5d1b688006e0e184ca0279c65c5dca2f109f9d5 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sun, 20 Mar 2022 16:17:42 +0100 Subject: [PATCH] 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 --- js/utils/color.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/utils/color.js b/js/utils/color.js index 1043f83..edf67c4 100644 --- a/js/utils/color.js +++ b/js/utils/color.js @@ -29,9 +29,9 @@ export const colorToRgb = ( color ) => { if( hex6 && hex6[1] ) { hex6 = hex6[1]; return { - r: parseInt( hex6.substr( 0, 2 ), 16 ), - g: parseInt( hex6.substr( 2, 2 ), 16 ), - b: parseInt( hex6.substr( 4, 2 ), 16 ) + r: parseInt( hex6.slice( 0, 2 ), 16 ), + g: parseInt( hex6.slice( 2, 4 ), 16 ), + b: parseInt( hex6.slice( 4, 6 ), 16 ) }; }