From ff1f37a91b84180c8ed6a356b53a70d4ec448ba1 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Tue, 22 Mar 2022 16:19:02 +0100 Subject: [PATCH] refactor: 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 --- src/framework/theme/services/color.helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/framework/theme/services/color.helper.ts b/src/framework/theme/services/color.helper.ts index 46fab33eb0..1a3ce1ecee 100644 --- a/src/framework/theme/services/color.helper.ts +++ b/src/framework/theme/services/color.helper.ts @@ -13,8 +13,8 @@ export class NbColorHelper { let result = '#'; for (let i = 1; i < 7; i += 2) { - const firstPart = h2d(color1.substr(i, 2)); - const secondPart = h2d(color2.substr(i, 2)); + const firstPart = h2d(color1.slice(i, i + 2)); + const secondPart = h2d(color2.slice(i, i + 2)); const resultPart = d2h(Math.floor(secondPart + (firstPart - secondPart) * (weight / 100.0))); result += ('0' + resultPart).slice(-2); }