Unity-Technologies / Unity-Technologies/Unity.Mathematics
Add implicit cast from floatN/halfN to UnityEngine.Color and back
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice to be able to implicitly cast from a color to a vector and back.
Currently I'm using an extension method like this, but I it would be nicer to just cast from one to the other.
public static class Extensions
{
public static float3 ToFloat3(this Color c)
{
return new float3(c.r, c.b, c.b);
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the vector types named in the request, including floatN and halfN, and the UnityEngine.Color conversion entry points. Determine which color-to-vector and vector-to-color conversions are intended, then verify that the implicit casts cover the requested types in both directions. The issue does not name files or tests, so the relevant definitions and validation coverage must be found in the repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100