def color_string(self, x):
        """Return a string formatted delta for the values in x.

        Args:
            x: 2-item list of integers (representing number of calls) or
               2-item list of floats (representing seconds of runtime).

        Returns:
            A list with [formatted x[0], [color, formatted delta]], where
            color reflects whether x[1] is lower, greater, or the same as
            x[0].
        """
        diff_str = ""
        color = "black"

        if len(x) == 2 and self.compare_file is not None:
            difference = x[0] - x[1]
            if difference:
                color, sign = ('green', '-') if difference < 0 else ('red', '+')
                diff_str = '{}{}'.format(sign, self.format_measure(difference))
        return [self.format_measure(x[0]), [diff_str, color]]
def color_string ( self , x ) : diff_str = "" color = "black" if len ( x ) == 2 and self . compare_file is not None : difference = x [ 0 ] - x [ 1 ] if difference : color , sign = ( 'green' , '-' ) if difference < 0 else ( 'red' , '+' ) diff_str = '{}{}' . format ( sign , self . format_measure ( difference ) ) return [ self . format_measure ( x [ 0 ] ) , [ diff_str , color ] ]
Return a string formatted delta for the values in x.

        Args:
            x: 2-item list of integers (representing number of calls) or
               2-item list of floats (representing seconds of runtime).

        Returns:
            A list with [formatted x[0], [color, formatted delta]], where
            color reflects whether x[1] is lower, greater, or the same as
            x[0].