@@ -472,25 +472,15 @@ def to_vispy(self) -> vispy.color.Colormap:
472472 """Return a vispy colormap."""
473473 return _external .to_vispy (self )
474474
475- @overload
476- def to_pygfx (
477- self , N : int = ..., * , as_view : Literal [True ] = ...
478- ) -> pygfx .TextureView :
479- ...
480-
481- @overload
482- def to_pygfx (self , N : int = ..., * , as_view : Literal [False ]) -> pygfx .Texture :
483- ...
484-
485- def to_pygfx (
486- self , N : int = 256 , * , as_view : bool = True
487- ) -> pygfx .TextureView | pygfx .Texture :
488- """Return a pygfx TextureView, or Texture if as_view is False.
489-
490- If you want to customize the TextureView, use `as_view == False` and then
491- call `get_view()` on the returned Texture, providing the desired arguments.
492- """
493- return _external .to_pygfx (self , N = N , as_view = as_view )
475+ def to_pygfx (self , N : int = 256 , * , as_view : bool | None = None ) -> pygfx .Texture :
476+ """Return a pygfx Texture."""
477+ if as_view is not None :
478+ warnings .warn (
479+ "as_view argument is deprecated and does nothing" ,
480+ DeprecationWarning ,
481+ stacklevel = 2 ,
482+ )
483+ return _external .to_pygfx (self , N = N )
494484
495485 def to_napari (self ) -> napari .utils .colormaps .Colormap :
496486 """Return a napari colormap.
0 commit comments