Improved data model for storing transparency alpha and other properties that are edited using a slider widget; as a result, the editing is more precise and does not randomly change to neighboring values

This commit is contained in:
Bane Stojkovic
2026-04-06 21:04:55 +02:00
parent 124d1ab577
commit 194c8e0606
98 changed files with 12813 additions and 13008 deletions
@@ -235,7 +235,7 @@ public class CalcUtilsTest {
assertEquals(Color.BLACK.getRed(), result.getRed());
assertEquals(Color.BLACK.getGreen(), result.getGreen());
assertEquals(Color.BLACK.getBlue(), result.getBlue());
assertEquals(128, result.getAlpha());
assertEquals(128, result.getAlpha().getValue());
// Test light color with alpha - should become WHITE
Color transparentLight = new Color(255, 255, 200, 128);
@@ -243,16 +243,16 @@ public class CalcUtilsTest {
assertEquals(Color.WHITE.getRed(), result.getRed());
assertEquals(Color.WHITE.getGreen(), result.getGreen());
assertEquals(Color.WHITE.getBlue(), result.getBlue());
assertEquals(128, result.getAlpha());
assertEquals(128, result.getAlpha().getValue());
// Test fully transparent color
Color transparent = new Color(100, 150, 200, 0);
result = CalcUtils.convertToMonochrome(transparent);
assertEquals(0, result.getAlpha());
assertEquals(0, result.getAlpha().getValue());
// Test opaque color - alpha should remain 255
Color opaque = new Color(50, 50, 50);
result = CalcUtils.convertToMonochrome(opaque);
assertEquals(255, result.getAlpha());
assertEquals(255, result.getAlpha().getValue());
}
}