original_docstring: Returns the color name from RGB
  
          :return: Name of the color as a string
          :rtype: str
          
docstring: Returns the color name from RGB
docstring_tokens: Returns the color name from RGB
code: def segment_color(self, r, g, b):
          """Returns the color name from RGB
  
          :return: Name of the color as a string
          :rtype: str
          """
          table = [("black",(0,0,0)),
                   ("violet",(127,0,255)),
                   ("blue",(0,0,255)),
                   ("cyan",(0,183,235)),
                   ("green",(0,128,0)),
                   ("yellow",(255,255,0)),
                   ("red",(255,0,0)),
                   ("white",(255,255,255))]
          near = ""
          euc = math.inf
          for itm in table:
              cur = math.sqrt((r - itm[1][0])**2 + (g - itm[1][1])**2 + (b - itm[1][2])**2)
              if cur < euc:
                  near = itm[0]
                  euc = cur
          return near
code_tokens: def segment_color ( self , r , g , b ) : table = [ ( "black" , ( 0 , 0 , 0 ) ) , ( "violet" , ( 127 , 0 , 255 ) ) , ( "blue" , ( 0 , 0 , 255 ) ) , ( "cyan" , ( 0 , 183 , 235 ) ) , ( "green" , ( 0 , 128 , 0 ) ) , ( "yellow" , ( 255 , 255 , 0 ) ) , ( "red" , ( 255 , 0 , 0 ) ) , ( "white" , ( 255 , 255 , 255 ) ) ] near = "" euc = math . inf for itm in table : cur = math . sqrt ( ( r - itm [ 1 ] [ 0 ] ) ** 2 + ( g - itm [ 1 ] [ 1 ] ) ** 2 + ( b - itm [ 1 ] [ 2 ] ) ** 2 ) if cur < euc : near = itm [ 0 ] euc = cur return near
short_docstring: Returns the color name from RGB
short_docstring_tokens: Returns the color name from RGB
comment: """Returns the color name from RGB
  
          :return: Name of the color as a string
          :rtype: str
          """