Skip to content

Commit 0330ce6

Browse files
authored
Colors - getTintColor - get key from a single digit (ex. green1, green5) (#2452)
1 parent 88e7e8d commit 0330ce6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/style/colors.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ export class Colors {
185185
const shouldReverseOnDark =
186186
!options?.avoidReverseOnDark && this.shouldSupportDarkMode && Scheme.getSchemeType() === 'dark';
187187
const key = shouldReverseOnDark ? colorKeys[colorKeys.length - 1 - keyIndex] : tintKey;
188+
188189
const requiredColorKey = `${colorKey.slice(0, -2)}${key}`;
189-
const requiredColor = this[requiredColorKey];
190-
190+
const requiredColorKey1 = `${colorKey.slice(0, -1)}${key}`;
191+
const requiredColor = this[requiredColorKey] || this[requiredColorKey1];
191192
if (_.isUndefined(requiredColor)) {
192193
return this.getTintedColorForDynamicHex(color, tintKey);
193194
}

0 commit comments

Comments
 (0)