By default magento 2 provide that option. During configuration product , on the third step u can choose "Apply unique prices by attribute to each SKU" and assign unique price for your super attribute
Added more SC for your clarification
If you are on a product page then
should do the job
If you are handling the product collection in your block code, I would look into adding
As of Magento 2.2 the admin System Configuration Panel "Advanced" has been removed.
The following gives reference on how to disable a module's output.