That really won’t result in any noticeable performance difference. Since you’re just getting a value.
However, for some cases I do prefer using an interface with some values i.e. for storing keys for Bundles or SharedPreferences. That way you can easily access the key values without a reference to context or resources. But that is totally unrelated to performance.
The benefits by using colors/themes/dimens etc in xml are probably greater than if you’d use code.