def to_hex(num):
 if (num < 0):
  return ('-0x%x' % (- num))
 else:
  return ('0x%x' % num)

def to_hex ( num ) : if ( num < 0 ) : return ( '-0x%x' % ( - num ) ) else : return ( '0x%x' % num )
convert c to a hex color .