A code for grabbing the color palette from an image. Uses C#.NET and Unity 2DTexture to make it happen.
Origin Project Color Thief
Ported Project of Color Thief .NET
Dominant Color
var dominant = new ColorThief.ColorThief();
Color color = dominant.GetColor(texture).UnityColor;
Palette Color
var palette = new ColorThief.ColorThief();
List<ColorThief.QuantizedColor> colors = palette.GetPalette(texture, paletteColors.Length);