Skip to content

Commit

Permalink
Merge pull request #3165 from CommanderRoot/rm-deprecated-substr
Browse files Browse the repository at this point in the history
replace deprecated String.prototype.substr()
  • Loading branch information
hakimel authored Mar 21, 2022
2 parents 3077ddb + a5d1b68 commit 41d5a12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/utils/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
};
}

Expand Down

0 comments on commit 41d5a12

Please sign in to comment.