Private
Public Access
Fixed color conversion
This commit is contained in:
1 parent
d5e52853c1
commit
3623ddcbfa
1 file changed
+2
-1
+2
-1
@@ -30,7 +30,8 @@ namespace Advanced_Software_Engineering.Verbs.Value.ValueTypes {
|
|||||||
public Color ToColor() {
|
public Color ToColor() {
|
||||||
if (!colorValueCacheAvailable) {
|
if (!colorValueCacheAvailable) {
|
||||||
int i = (int)Math.Round(value * 255);
|
int i = (int)Math.Round(value * 255);
|
||||||
i = Math.Max(255, i);
|
i = Math.Min(255, i);
|
||||||
|
if (i < 0) i = 0;
|
||||||
colorValueCache = ValueHelper.IntsToColor(i, i, i);
|
colorValueCache = ValueHelper.IntsToColor(i, i, i);
|
||||||
colorValueCacheAvailable = true;
|
colorValueCacheAvailable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user