✅ Hex color converter breaks on 3-digit and 4-digit values
I made this nifty lil' converter from hexadecimal strings to
System.Drawing.Color
s. It works perfectly for 6-digit and 8-digit values, but tests fail for 3-digit and 4-digit ones.
![No description](https://cdn.answeroverflow.com/1205599966555414608/image.png)
![No description](https://cdn.answeroverflow.com/1205599966886891620/image.png)
![No description](https://cdn.answeroverflow.com/1205599967134220298/image.png)
![No description](https://cdn.answeroverflow.com/1205599967377621123/image.png)
1 Reply
Ah, derp, nevermind
The test was faulty
I was trying to assert that
4F0
produces Color.FromArgb(0x4, 0xF, 0x0)
where it should've been Color.FromArgb(0x44, 0xFF, 0x00)
since each digit in a 3-digit code needs to be duplicated
Same for 4-digit codes