How to get swatches working when products are out of stock

At the moment this is what I get: enter image description here But if my both options are out of stock it wouldn’t display the colour black or the option I want them two display there even if they out of stock with red line which is un clickable Is this possible to do