<?php
$colors = ['#cc9966', '#99ccff', '#ff6666', '#67c23a'];
$tags = get_the_tags();
if ($tags) {
    ?>
    <div class="post-tag-list-warp">
        <div class="tag-list">
            <div class="tag-icon">
                <i class="el-icon-price-tag"></i>
            </div>
            <?php
            foreach ($tags as $tag) {
                $color = $colors[array_rand($colors)];
                echo '<a class="tag-item" style="background:' . $color . '" href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>';
            }
            ?>
        </div>
    </div>
    <?php
}
?>