public void Initialize() { colorCatalogue = Substitute.For <IColorCatalogue>(); var logger = Substitute.For <ILogger <Downloader> >(); colorMatcher = new ColorMatcher(colorCatalogue); }
private int FindClosestEntryInPalette(uint PixelColor, List <ColorType> ColorTypes, List <uint> PotentialColors) { int index = 0; foreach (var color in PotentialColors) { if (PixelColor == color) { return((int)ColorTypes[index]); } ++index; } index = ColorMatcher.MatchColor(ColorMatchType.HUE_DISTANCE, (byte)(PixelColor >> 16), (byte)(PixelColor >> 8), (byte)PixelColor, PotentialColors); return((int)ColorTypes[index]); }