mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Aded operators to create numerics
This commit is contained in:
1 parent
da0d3abbdd
commit
3f9de63b06
1 file changed
+6
-1
@@ -159,7 +159,12 @@ public readonly struct Numeric : IComparable<Numeric>, IConvertible
|
|||||||
{
|
{
|
||||||
return (byte) Math.Clamp(p._value, 0, 255);
|
return (byte) Math.Clamp(p._value, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator Numeric(double d) => new(d);
|
||||||
|
public static implicit operator Numeric(float f) => new(f);
|
||||||
|
public static implicit operator Numeric(int i) => new(i);
|
||||||
|
public static implicit operator Numeric(byte b) => new(b);
|
||||||
|
|
||||||
public static implicit operator long(Numeric p)
|
public static implicit operator long(Numeric p)
|
||||||
{
|
{
|
||||||
return (long) p._value;
|
return (long) p._value;
|
||||||
|
|||||||
Reference in new issue
Block a user