NSAttributedString text printing out grey instead of black?

This is because of you set weight to strokeWidth NSAttributedStringKey.strokeWidth: UIFont.Weight.semibold. You can use the below code that may help you.

amountText.setAttributes([NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15, weight: .semibold),
                              NSAttributedString.Key.foregroundColor: UIColor.black],
                             range: NSMakeRange(0, usersNameDigits))