Preheat your oven to 375°F. Grease a 9x13-inch baking dish with butter.
In a saucepan over medium heat, melt the butter. Stir in the flour and cook for about 1 minute until bubbly.
Gradually whisk in the heavy cream and milk, then add garlic powder, salt, black pepper, and paprika. Continue to cook, stirring constantly, until the mixture thickens, about 3-5 minutes.
Layer half of the sliced potatoes in the prepared baking dish, followed by half of the sliced onions. Pour half of the cream mixture over the potatoes and sprinkle with half of the cheese.
Repeat with the remaining potatoes, onions, cream mixture, and top with the remaining cheese.
Cover the dish with aluminum foil and bake for 45 minutes.
Remove the foil and bake for an additional 15-20 minutes, or until the potatoes are tender and the top is golden brown.
Let the dish cool for about 10 minutes before serving.