Vector2 AspectRatio

Does anyone know how I would go about replicating the effects of UIAspectRatio but with Vector2?
An idea I had is checking the closest number that is divisible by the aspect ratio I want, but I feel like the only ways I could do that would be inefficient, anyone have any ideas?