Unity-Technologies / Unity.Mathematics

The C# math library used in Unity providing vector types and math functions with a shader like syntax
Other
1.38k stars 156 forks source link

Why isn't there an implicit cast from Color to float4 and vice-versa? #204

Closed aybe closed 2 years ago

aybe commented 2 years ago

Currently, the way to convert a Color to a float4 is as follows:

float4 value = (Vector4)Color.red;

It works, but it's cumbersome...

Have you considered adding such implicit cast or is there something under the hood that makes it a no-go?

aybe commented 2 years ago

105