I'm trying to use functions in \Magento\Swatches\Block\Product\Renderer\Listing\Configurable directly from my controller.
Ive created an instance like this :
$swatchInstance = $this->layoutFactory->create()->createBlock('\Magento\Swatches\Block\Product\Renderer\Listing\Configurable');
but when i try to use functions like
$swatchInstance->getJsonSwatchSizeConfig()
I am getting the error
Uncaught Error: Call to a member function getTypeInstance() on null