Using wp_tag_cloud with only current post tag with special class

I was able to achieve this by following code:

        $allterms = get_terms( $taxonomy );
        $pterms = get_the_terms( $post->ID, $taxonomy);
        $tag_list = implode(',', wp_list_pluck($pterms, 'term_id') );
        $t = explode(',', $tag_list);
        echo '<div class="tag-cloud">';
        foreach ($allterms as $term)
        {
            if (in_array($term->term_id, $t))
            {
                echo '<span class="stag active">'.$term->name.'</span>';
            }
            else
            { echo '<span class="stag inactive">'.$term->name.'</span>'; }
        }
        echo '</div>';