def detect_palette_support(basic_palette=None):
result = col_init = win_enabled = None<EOL>TERM = env.TERM or '<STR_LIT>'<EOL>if os_name == '<STR_LIT>':<EOL><INDENT>from .windows import (is_ansi_capable, enable_vt_processing,<EOL>is_colorama_initialized)<EOL>if is_ansi_capable():<EOL><INDENT>win_enabled = all(enable_vt_processing())<EOL><DEDENT>col_init = is_colorama_initialized()<EOL><DEDENT>if TERM.startswith('<STR_LIT>') or (TERM == '<STR_LIT>') or col_init:<EOL><INDENT>result = '<STR_LIT>'<EOL><DEDENT>if ('<STR_LIT>' in TERM) or (TERM == '<STR_LIT>') or env.ANSICON:<EOL><INDENT>result = '<STR_LIT>'<EOL><DEDENT>if env.COLORTERM in ('<STR_LIT>', '<STR_LIT>') or win_enabled:<EOL><INDENT>result = '<STR_LIT>'<EOL><DEDENT>pal_name = '<STR_LIT>'<EOL>if result and not basic_palette:<EOL><INDENT>result, pal_name, basic_palette = _find_basic_palette(result)<EOL><DEDENT>try:<EOL><INDENT>import webcolors<EOL><DEDENT>except ImportError:<EOL><INDENT>webcolors = None<EOL><DEDENT>log.debug(<EOL>f'<STR_LIT>'<EOL>f'<STR_LIT>'<EOL>f'<STR_LIT>'<EOL>)<EOL>return (result, basic_palette)<EOL>
Returns whether we think the terminal supports basic, extended, or
        truecolor.  None if not able to tell.

        Returns:
            None or str: 'basic', 'extended', 'truecolor'