parameters: (self, x)
return_statement: return col
docstring: Returns the color at any position x(between 0 and 1)
          https://github.com/synfig/synfig/blob/ae11655a9bba068543be7a5df9090958579de78e/synfig-core/src/synfig/gradient.cpp#L178
  
          Args:
              x (float) : position at which value of color is needed
  
          Returns:
              (common.Color.Color) : color at position x
docstring_summary: Returns the color at any position x(between 0 and 1)
          https://github.com/synfig/synfig/blob/ae11655a9bba068543be7a5df9090958579de78e/synfig-core/src/synfig/gradient.cpp#L178
docstring_tokens: Returns the color at any position x ( between 0 and 1 ) https : // github . com / synfig / synfig / blob / ae11655a9bba068543be7a5df9090958579de78e / synfig - core / src / synfig / gradient . cpp#L178
function: def get_color_at_x(self, x):
          """
          Returns the color at any position x(between 0 and 1)
          https://github.com/synfig/synfig/blob/ae11655a9bba068543be7a5df9090958579de78e/synfig-core/src/synfig/gradient.cpp#L178
  
          Args:
              x (float) : position at which value of color is needed
  
          Returns:
              (common.Color.Color) : color at position x
          """
          if len(self.colors) == 0:
              return Color()
          if len(self.colors) == 1 or math.isnan(x):
              return self.reverse_gamma(self.colors[0][1])
  
          # point is outside of gradient
          if x <= self.colors[0][0]:
              return self.reverse_gamma(self.colors[0][1])
          if x >= self.colors[-1][0]:
              return self.reverse_gamma(self.colors[-1][1])
  
          # upper bound
          i = self.upper_bound(self.colors, x, 0, len(self.colors))
          # considering i stores the upper bound
          j = i
          i = i - 1
          d = self.colors[j][0] - self.colors[i][0]
          if d <= common.misc.real_high_precision():
              return self.reverse_gamma(self.colors[i][1])
  
          amount = (x - self.colors[i][0]) / d
          col = self.blend(self.reverse_gamma(self.colors[i][1]), self.reverse_gamma(self.colors[j][1]), amount)
          return col
function_tokens: def get_color_at_x ( self , x ) : if len ( self . colors ) == 0 : return Color ( ) if len ( self . colors ) == 1 or math . isnan ( x ) : return self . reverse_gamma ( self . colors [ 0 ] [ 1 ] ) # point is outside of gradient if x <= self . colors [ 0 ] [ 0 ] : return self . reverse_gamma ( self . colors [ 0 ] [ 1 ] ) if x >= self . colors [ - 1 ] [ 0 ] : return self . reverse_gamma ( self . colors [ - 1 ] [ 1 ] ) # upper bound i = self . upper_bound ( self . colors , x , 0 , len ( self . colors ) ) # considering i stores the upper bound j = i i = i - 1 d = self . colors [ j ] [ 0 ] - self . colors [ i ] [ 0 ] if d <= common . misc . real_high_precision ( ) : return self . reverse_gamma ( self . colors [ i ] [ 1 ] ) amount = ( x - self . colors [ i ] [ 0 ] ) / d col = self . blend ( self . reverse_gamma ( self . colors [ i ] [ 1 ] ) , self . reverse_gamma ( self . colors [ j ] [ 1 ] ) , amount ) return col