class_docstr: Visual subclass that actually renders the ColorBar.
  
  Parameters
  ----------
   pos : tuple (x, y)
      Position where the colorbar is to be placed with
      respect to the center of the colorbar
  halfdim : tuple (half_width, half_height)
      Half the dimensions of the colorbar measured
      from the center. That way, the total dimensions
      of the colorbar is (x - half_width) to (x + half_width)
      and (y - half_height) to (y + half_height)
  cmap : str | vispy.color.ColorMap
      Either the name of the ColorMap to be used from the standard
      set of names (refer to `vispy.color.get_colormap`),
      or a custom ColorMap object.
      The ColorMap is used to apply a gradient on the colorbar.
   orientation : {'left', 'right', 'top', 'bottom'}
      The orientation of the colorbar, used for rendering. The
      orientation can be thought of as the position of the label
      relative to the color bar.
  
  Note
  ----
  This is purely internal.
  Externally, the ColorBarVisual must be used.
  This class was separated out to encapsulate rendering information
  That way, ColorBar simply becomes a CompoundVisual
  
  See Also
  --------
  vispy.visuals.ColorBarVisual
class_docstr_tok: ["Visual","subclass","that","actually","renders","the","ColorBar",".","Parameters","--","--","--","--","--","pos",":","tuple","(","x",",","y",")","Position","where","the","colorbar","is","to","be","placed","with","respect","to","the","center","of","the","colorbar","halfdim",":","tuple","(","half_width",",","half_height",")","Half","the","dimensions","of","the","colorbar","measured","from","the","center",".","That","way",",","the","total","dimensions","of","the","colorbar","is","(","x","-","half_width",")","to","(","x","+","half_width",")","and","(","y","-","half_height",")","to","(","y","+","half_height",")","cmap",":","str","|","vispy.color.ColorMap","Either","the","name","of","the","ColorMap","to","be","used","from","the","standard","set","of","names","(","refer","to","`","vispy.color.get_colormap","`",")",",","or","a","custom","ColorMap","object",".","The","ColorMap","is","used","to","apply","a","gradient","on","the","colorbar",".","orientation",":","{","'left","'",",","'right","'",",","'top","'",",","'bottom","'","}","The","orientation","of","the","colorbar",",","used","for","rendering",".","The","orientation","can","be","thought","of","as","the","position","of","the","label","relative","to","the","color","bar",".","Note","--","--","This","is","purely","internal",".","Externally",",","the","ColorBarVisual","must","be","used",".","This","class","was","separated","out","to","encapsulate","rendering","information","That","way",",","ColorBar","simply","becomes","a","CompoundVisual","See","Also","--","--","--","--","vispy.visuals.ColorBarVisual"]
code: def _get_texcoord_func(orientation):
      if orientation == "top" or orientation == "bottom":
          func = Function(
              """
                  float orient_texcoord(vec2 texcoord) {
                      return texcoord.x;
                  }
              """
          )
      elif orientation == "left" or orientation == "right":
          func = Function(
              """
                  float orient_texcoord(vec2 texcoord) {
                      return 1 - texcoord.y;
                  }
              """
          )
      return func
  
imports: from functools import lru_cache
  import numpy
  from .None import Visual, TextVisual, CompoundVisual, _BorderVisual
  from .shaders import Function
  from ..color import get_colormap
label_desc: Use image node_id 3 for calling the _CoreColorBarVisual obj's underlying member method code with example usage: obj._get_texcoord_func(orientation) and returns: func