3 ms·
A lot of JavaScript color manipulation libraries use arrays to represent a color. Like c[0] = R, c[1] = G, c[2] = B. .NET ports of such libraries can be hugely
by garganzol 9y ago
A lot of JavaScript color manipulation libraries use arrays to represent a color. Like c[0] = R, c[1] = G, c[2] = B.
.NET ports of such libraries can be hugely improved by using value tuples for color representation, while keeping the original array-based semantics.
- naasking 9y agoBut why keep the original array-based semantics if you're using a tuple? In fact, I'm not even sure why you'd use a ValueTuple for that at all, because it's not a tuple but more of a vector type because the elements are all of the same type. You'd probably want a more meaningful domain-specific type.