How can I enable HTML output for checkbox options? I am adding theme styling settings and I would like to have associated color to the checkbox in themes setting form. So far, i haven't been able to do so, because the output strips inline styling and then external styling is being reset for the admin view. How do you enable html output of the text next to the checkbox?

Here is my code so far:

function THEMENAME_form_system_theme_settings_alter(&amp;$form, &amp;$form_state){
       $form['theme_style'] = array(
        '#title' =&gt; 'Theme Style',
        '#type' =&gt; 'fieldset',
        '#collapsible' =&gt; FALSE,
        '#collapsed' =&gt; FALSE,
    );
    $form['theme_style']['color'] = array(
        '#title' =&gt; t('Color Skin'),
        '#type' =&gt; 'checkboxes',
        '#options' =&gt; color_schemas(),
//        '#process' =&gt; array(),
        '#pre_render' =&gt; array(),
        '#post_render' =&gt; array(),
        '#format' =&gt; array('text_format' =&gt; 'full_html'),
    );
}

function color_schemas(){
   $colors = array(
        'blue' =&gt; htmlentities('&lt;span style="display:inline-block;width:20px;height:20px;background-color:#DDD;vertical-align:middle;border-radius:0"&gt;Blue&lt;/span&gt;'),
        'black' =&gt; '&lt;span id="black-skin"&gt;Black&lt;/span&gt;',
        'maroon' =&gt; t('Maroon'),
        'grey' =&gt; t('Grey'),
        'white' =&gt; t('White'),
    );
    return $colors;
}


Here i try different things. To set the text format in '#format' attribute. I also attach 'id' element so could style in external style sheet but those are reset by admin imported CSS. I also try convert all html entities and output which works but it doesn't render the html correctly
For starters, if you're using an admin theme like Seven for your administration pages, nothing on those pages will ever be affected by another theme's code. If you need to write code that applies across any theme, then you should be putting that in a module.

Inline styles are an attack vector for XSS, which is why they're generally not allowed in any kind of markup that is the result of user input. That includes the label text for a form element, such as a checkbox: the label is constructed by theme_form_element_label(), which sanitizes the text with filter_xss_admin(). That's absolutely the correct thing to do.

The proper way to do this is to put your styles in an external spreadsheet, as you've mentioned. Consider whether you could implement your code as a module instead.