you can also do:
ofVec3f col;
auto nearest = std::min_element(colors.begin(), colors.end(), [&](Colors&c){
return c.squareDistance(col);
});
which returns an iterator to nearest element in the original vector so later you can do:
nearest->x = ...;
or
ofVec3f v = *nearest;