Which of the below is a good practice. Second looks more readable for me but would like to know how others think.
Solution 1 :
case colorElementEnum.ICON:
color = colors.buttonText;
if (isHighContrast) {
if (!titleColor) {
if (disabled) {
color = colors.lightGray;
}
}
}
return color;
Solution 2 :
case colorElementEnum.ICON:
color = colors.buttonText;
if (isHighContrast && !titleColor && disabled) {
color = colors.lightGray;
}
return color;