Action: Colorbox

Compatible with: R5.x
Current version:
Credits: WikiAdmin

visualize color sets as boxes


{{colorbox}}


/action/colorbox.php
<?php
 
/*
 
visualize color sets as boxes
 
{{cobo bg="#FDFEB8" bd="#FFBB00"}}
    $bg - background color
    $bd - border color
    $ds - description
    $tc - text color
    $bw - border width
    $width - width
    $spec - show color values
*/
 
if (!isset($ds))        $ds        = NULL;
if (!isset($bw))        $bw        = 1;
if (!isset($bg))        $bg        = '#ffa';
if (!isset($bd))        $bd        = '#000000';
if (!isset($tc))        $tc        = '#000000';
if (!isset($width))        $width    = '200px';
if (!isset($spec))        $spec    = 1;
 
echo '<div style="
        background-color: ' . $bg . ';
        border: ' . (int) $bw . 'px solid ' . $bd . ';
        width: ' . (int) $width . ';
        clear: both;
        margin: 10px 0;
        padding: 10px;
        color: ' . $tc . ';
        float: left;">' .
        $this->format($ds) . ''.
        ($spec
            ? '<br>' .
              'background: ' . $bg . '<br>' .
              'border: ' . $bd . '<br>' .
              'color: ' . $tc . ''
            : ''
    ) . "</div>\n";
 
?>

info
background: #FFFFE0
border: #E6DB55
color: #555555

success
background: #C3FF88
border: #8DFF1C
color: #555555

ok
background: #FFEC8B
border: #FFCC00
color: #555555

error
background: #FFB78C
border: #FF853C
color: #555555

error
background: #FFA0A0
border: #F04040
color: #555555

info
background: #FFFBCC
border: #E6DB55
color: #555555

message
background: #DDFFDD
border: #BBFFBB
color: #000000

info
background: #DDEEFF
border: #99CCFF
color: #000000

warning
background: #FDFEB8
border: #FFBB00
color: #000000

error
background: #FFDDDD
border: #FFBBBB
color: #000000

notice
background: #F9F9E5
border: #E8E3AA
color: #828400
info
background: #E5ECF9
border: #AAC6E8
color: #0055B5
success
background: #E9F9E5
border: #B4E8AA
color: #1C8400
error
background: #F9E5E6
border: #E8AAAD
color: #B50007

hint
background: #FFFDE3
border: #E5E1A9
color: #444444

success
background: #F0FFF0
border: #ACCBAC
color: #000000

info
background: #e5eef7
border: #96c2ee
color: #333