def recolor(self, random_state=None, color_func=None, colormap=None):
if isinstance(random_state, int):<EOL><INDENT>random_state = Random(random_state)<EOL><DEDENT>self._check_generated()<EOL>if color_func is None:<EOL><INDENT>if colormap is None:<EOL><INDENT>color_func = self.color_func<EOL><DEDENT>else:<EOL><INDENT>color_func = colormap_color_func(colormap)<EOL><DEDENT><DEDENT>self.layout_ = [(word_freq, font_size, position, orientation,<EOL>color_func(word=word_freq[<NUM_LIT:0>], font_size=font_size,<EOL>position=position, orientation=orientation,<EOL>random_state=random_state,<EOL>font_path=self.font_path))<EOL>for word_freq, font_size, position, orientation, _<EOL>in self.layout_]<EOL>return self<EOL>
Recolor existing layout.

        Applying a new coloring is much faster than generating the whole
        wordcloud.

        Parameters
        ----------
        random_state : RandomState, int, or None, default=None
            If not None, a fixed random state is used. If an int is given, this
            is used as seed for a random.Random state.

        color_func : function or None, default=None
            Function to generate new color from word count, font size, position
            and orientation.  If None, self.color_func is used.

        colormap : string or matplotlib colormap, default=None
            Use this colormap to generate new colors. Ignored if color_func
            is specified. If None, self.color_func (or self.color_map) is used.

        Returns
        -------
        self