Changing elements for spells

I think I remember in an older version of D&D allowing you to change a fire spell into a cold-based spell, or vice versa. In 5E, is there any way to allow you to alter say a Scorching Ray into a lightning or cold-based attack? I thought maybe sorcerer spell points might have done the trick, but I cannot find any rule that would cover it. I’m sure you could design and research a spell for that character during a downtime roleplaying option, but I was looking more for a ‘on-the-fly’ type option.