User blog comment:Catinthedark/Infobox level: killing the massive switches/@comment-3225604-20150705085205/@comment-4189499-20150705221812

You don't need to do every single permutation and combination of difficulties because, as written at User_blog:Imamadmad/Changes_to_Template:Difficulty_level (and should probably be moved to the documentation of Difficulty level), you can specify the mobile and Facebook difficulties separately meaning you just need to test if the mobile and Fb difficulties are different (#ifeq:) and then use that result to determine the layout (single or double difficulty) and then run the level through B to get the needed colour for each section. That would be much shorter than what we currently have anyway, which was created before we had the separate difficulties.