def get_visual_for_depth(screen, depth):
        """
        Returns the visual object of the screen @ some depth

        For an ARGB visual -> depth=32
        For a RGB visual   -> depth=24
        """
        allowed = screen.allowed_depths
        if depth not in [x.depth for x in allowed]:
            logger.warning("Unsupported colour depth: %s", depth)
            return

        for i in allowed:
            if i.depth == depth:
                if i.visuals:
                    return i.visuals[0]

        Returns the visual object of the screen @ some depth

        For an ARGB visual -> depth=32
        For a RGB visual   -> depth=24
        
libqtile/backend/x11/xcbq.py