def _split_attributes(self, attrs):
        """Spilt attribute code
        
        Takes an attribute code and returns a tuple containing
        foreground (fg), foreground intensity (fgi), background (bg), and
        background intensity (bgi)
        
        Attributes can be joined using ``fg | fgi | bg | bgi``
        """
        fg = attrs & self.FG_ALL
        fgi = attrs & self.FG_INTENSITY
        bg = attrs & self.BG_ALL
        bgi = attrs & self.BG_INTENSITY
        return fg, fgi, bg, bgi