MCPcopy Create free account
hub / github.com/comaps/comaps / ColorDistance

Function ColorDistance

libs/kml/color_parser.cpp:40–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40static int ColorDistance(uint32_t rgbaColor1, uint32_t rgbaColor2)
41{
42 auto const [r1, g1, b1] = ExtractRGB(rgbaColor1);
43 auto const [r2, g2, b2] = ExtractRGB(rgbaColor2);
44 return (r1 - r2) * (r1 - r2) + (g1 - g2) * (g1 - g2) + (b1 - b2) * (b1 - b2);
45}
46
47struct RGBAToGarmin
48{

Callers 2

MapGarminColorFunction · 0.85
MapPredefinedColorFunction · 0.85

Calls 1

ExtractRGBFunction · 0.85

Tested by

no test coverage detected