class_docstr: Convert strings to dvi files using TeX, caching the results to a directory.
  
  The cache directory is called ``tex.cache`` and is located in the directory
  returned by `.get_cachedir`.
  
  Repeated calls to this constructor always return the same instance.
class_docstr_tok: ["Convert","strings","to","dvi","files","using","TeX",",","caching","the","results","to","a","directory",".","The","cache","directory","is","called","``","tex.cache","``","and","is","located","in","the","directory","returned","by","`",".get_cachedir","`",".","Repeated","calls","to","this","constructor","always","return","the","same","instance","."]
docstr: Return latex's rendering of the tex string as an RGBA array.
  
  Examples
  --------
  >>> texmanager = TexManager()
  >>> s = r"\TeX\ is $\displaystyle\sum_n\frac{-e^{i\pi}}{2^n}$!"
  >>> Z = texmanager.get_rgba(s, fontsize=12, dpi=80, rgb=(1, 0, 0))
docstr_tok: ["Return","latex","'s","rendering","of","the","tex","string","as","an","RGBA","array",".","Examples","--","--","--","--",">",">",">","texmanager","=","TexManager","(",")",">",">",">","s","=","r","''","\\TeX\\","is","$","\\displaystyle\\sum_n\\frac","{","-e^","{","i\\pi","}","}","{","2^n","}","$","!","''",">",">",">","Z","=","texmanager.get_rgba","(","s",",","fontsize=12",",","dpi=80",",","rgb=","(","1",",","0",",","0",")",")"]
code: def get_rgba(cls, tex, fontsize=None, dpi=None, rgb=(0, 0, 0)):
      r"""
      Return latex's rendering of the tex string as an RGBA array.
  
      Examples
      --------
      >>> texmanager = TexManager()
      >>> s = r"\TeX\ is $\displaystyle\sum_n\frac{-e^{i\pi}}{2^n}$!"
      >>> Z = texmanager.get_rgba(s, fontsize=12, dpi=80, rgb=(1, 0, 0))
      """
      alpha = cls.get_grey(tex, fontsize, dpi)
      rgba = np.empty((*alpha.shape, 4))
      rgba[..., :3] = mpl.colors.to_rgb(rgb)
      rgba[..., -1] = alpha
      return rgba
  
imports: import functools
  import hashlib
  import logging
  import os
  from pathlib import Path
  import subprocess
  from tempfile import TemporaryDirectory
  import numpy
  import matplotlib
  from matplotlib import _api, cbook, dviread
label_desc: Use image node_id 13 for calling the TexManager obj's underlying member method code with example usage: obj.get_rgba(cls, tex, fontsize, dpi, rgb) and returns: rgba