implemented mean color distance