Suppose I can represent represent colors as triples $(\color{red}R, \color{green}G, \color{blue}B) \in [0,1]^3$. I have a finite collection of points in $\mathbb{R}^n$ that I would like to map to colors with a function $\phi : \mathbb{R}^n \mapsto [0,1]^3$ so that if points are closer together then they should have more similar colors.
Let us say we have a metric $d: \mathbb{R}^n \mapsto \mathbb{R}_{\geq 0}$ on the domain and a metric $q: \mathbb{R}^n \mapsto \mathbb{R}_{\geq 0}$ on the image so that for any $x,y,z,w \in \mathbb{R}^n$ if holds that
$$d(x,y) \geq d(z.w) \implies q(\phi(x), \phi(y)) \geq q(\phi(z), \phi(w)).$$
For my purposes I am looking for example $\phi : \mathbb{R}^n \mapsto [0,1]^3$ that preserves the above ordering (monotonicity), and it is fine if $d = q$ if the answerer finds that convenient. I have stated the question broadly to give flexibility to potential answerers to suggest whatever maps and metrics they are familiar with which satisfy the constraints.
I would appreciate such an example, if one exists.
I should add a constraint that the function $\phi$ needs to have an algorithm for calculation. It has to be something I can calculate on a given collection of points.