You can get this using Structlayouts to overlay both arrays. Although many of the answers here wrote on how to make color-struct also uint, this is about transforming the "array":
This evil.
public static class ColorExtension { public static uint[] GetUInts(this Color[] colors) { if(colors == null) throw new ArgumentNullException("colors"); Evil e = new Evil { Colors = colors}; return e.UInts; } [StructLayout(LayoutKind.Explicit)] struct Evil { [FieldOffset(0)] public Color[] Colors; [FieldOffset(0)] public uint[] UInts; } }
Basically these are two arrays referring to the same memory location.
So, if you want to get an uints array from an array of colors, do this:
Color[] colors = ... uint[] uints = colors.GetUInts();
As mentioned in the comments, you may also need to explicitly declare colorstruct, or the runtime may be distorted using an order leading to some “weird” uint values ...
[StructLayout(LayoutKind.Sequential)]
Do not try to debug it though ... 
source share