
     h                     ^    d Z ddlmZmZmZ ddlZddlZddlZd Zd Z	d	dZ
d Z ed      Zy)
zThis submodule contains miscellaneous tools that are used internally, but
aren't specific to SVGs or related mathematical objects.    )divisionabsolute_importprint_functionNc           	            j                  d       t               t         fdt        ddz        D              S )z~Converts a hexadeximal color string to an RGB 3-tuple

    EXAMPLE
    -------
    >>> hex2rgb('#0000FF')
    (0, 0, 255)
    #c              3   H   K   | ]  }t        ||d z  z    d        yw)      N)int).0ilvvalues     r/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/site-packages/svgpathtools/misctools.py	<genexpr>zhex2rgb.<locals>.<genexpr>   s'     HqU1Qr1uW%r*Hs   "r   r	   )lstriplentuplerange)r   r   s   `@r   hex2rgbr      s:     LLE	UBHE!RQ4GHHH    c                 :    dt        |       z  j                         S )z}Converts an RGB 3-tuple to a hexadeximal color string.

    EXAMPLE
    -------
    >>> rgb2hex((0,0,255))
    '#0000FF'
    z#%02x%02x%02x)r   upper)rgbs    r   rgb2hexr      s     eCj(//11r   c                 B    t        | |z
        ||t        |      z  z   k  S )z4This is essentially np.isclose, but slightly faster.)abs)abrtolatols       r   iscloser"   %   s"    q1u:s1v-..r   c                 x   t         j                  j                  |       s2t         j                  j                  t        j                         |       } t         j                  j                  |       st        d      t        j                  dk(  rd| z   } d}t        j                         j                  | |       y)zMAttempt to open file located at file_location in the default web
    browser.z

File not found.darwinzfile:///   )newN)ospathisfilejoingetcwdIOErrorsysplatform
webbrowsergetopen)file_locationr&   s     r   open_in_browserr3   *   s     77>>-(RYY[-@77>>-(+,, ||x"=0
CNN-S1r   zThis code should never be reached.  You've found a bug.  Please submit an issue to 
https://github.com/mathandy/svgpathtools/issues
with an easily reproducible example.)gh㈵>g:0yE>)__doc__
__future__r   r   r   r'   r-   r/   r   r   r"   r3   	ExceptionBugException r   r   <module>r9      sD   < A @ 	 
 
I2/
2&  B Cr   