You can calculate the perpendicular distance from each edge, and then take the minimum of the three edges. This is related to barycentric coordinates (which are normalized edge distances). If you already have the barycentrics $a, b, c$, you can calculate $3 \cdot \min(a, b, c)$. The 3 is to normalize the gradient to the [0, 1] range, since the centroid of the triangle lies at barycentrics $(\tfrac{1}{3}, \tfrac{1}{3}, \tfrac{1}{3})$.
The UV mapping you mentioned makes $u, v$ equal to two of the barycentrics, so you can then calculate the gradient coordinate as $3 \cdot \min(u, v, 1 - u - v)$.
This coordinate runs from 0 at the edges to 1 at the center, so to go from black at the enter to white at the edges, you could take 1 minus that. And of course, you can do any other gradient using this coordinate to interpolate the desired colors.