For a non-empty compact set $E$ in a proper subdomain $Omega$ of the complex plane, we denote the diameter of $E$ and the distance from $E$ to the boundary of $Omega$ by $d(E)$ and $d(E,partialOmega),$ respectively. The quantity $d(E)/d(E,partialOmega)$ is invariant under similarities and plays an important role in Geometric Function Theory. In the present paper, when $Omega$ has the hyperbolic distance $h_Omega(z,w),$ we consider the infimum $kappa(Omega)$ of the quantity $h_Omega(E)/log(1+d(E)/d(E,partialOmega))$ over compact subsets $E$ of $Omega$ with at least two points, where $h_Omega(E)$ stands for the hyperbolic diameter of the set $E.$ We denote the upper half-plane by $mathbb{H}$. Our main results claim that $kappa(Omega)$ is positive if and only if the boundary of $Omega$ is uniformly perfect and that the inequality $kappa(Omega)leqkappa(mathbb{H})$ holds for all $Omega,$ where equality holds precisely when $Omega$ is convex.