Commit dea6736
authored
Color alpha channel bug and add StandardColor tests
Updated the `Color` constructor for `StandardColor` to use `StandardColors.GetArgb` instead of casting to an integer, ensuring the alpha channel (`A`) is correctly set to `0xFF` (opaque). This resolves issues with name resolution and ARGB formatting.
Added a new test class, `ColorStandardColorTests`, to verify the behavior of `Color` when initialized with a `StandardColor`. Tests include:
- Verifying `ToString` returns the correct standard color name.
- Ensuring `ToString("G")` outputs the correct opaque ARGB value.
These changes address a bug where the alpha channel was incorrectly set to `0x00` (transparent).
1 parent 3a8cbf3 commit dea6736
File tree
2 files changed
+28
-1
lines changed- Terminal.Gui/Drawing/Color
- Tests/UnitTestsParallelizable/Drawing/Color
2 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments