vcs icon indicating copy to clipboard operation
vcs copied to clipboard

Docstring for color related methods are incorrect

Open zshaheen opened this issue 6 years ago • 16 comments

The docstring for vcs.colormap.Cp.setcolorcell() and other related methods needs to be updated. The RGB values need to be between 0-100, not 0-255.

In [3]: c.setcolorcell?
Signature: c.setcolorcell(index, red, green, blue, alpha=100.0)
Docstring:
Sets the R,G,B,A values of a colorcell

:Example:

    .. doctest:: colormap_setcolorcell

        >>> a = vcs.init() # Create a vcs Canvas
        >>> cmap = a.createcolormap('scc_cmap') # Create a colormap
        >>> cmap.setcolorcell(40,80,95,1.0) # Set RGBA values

:param index: Integer from 0-255.
:type index: `int`_

:param red: Integer from 0-255 representing the concentration of red in the colorcell.
:type red: `int`_

:param green: Integer from 0-255 representing the concentration of green in the colorcell.
:type green: `int`_

:param blue: Integer from 0-255 representing the concentration of blue in the colorcell.
:type blue: `int`_

:param alpha: Float representing the percentage of opacity in the colorcell.
:type alpha: `float`_

However, vcs.setcolorcell seems okay, but don't state the valid range of values.

In [4]: vcs.setcolorcell?
Signature: vcs.setcolorcell(obj, num, r, g, b, a=100)
Docstring:
Set a individual color cell in the active colormap. If default is
the active colormap, then return an error string.

.. note::

    If the the visual display is 16-bit, 24-bit, or 32-bit TrueColor,
    then a redrawing
    of the VCS Canvas is made every time the color cell is changed.

:Example:

    .. doctest:: utils_setcolorcell

        >>> vcs.setcolorcell("AMIP",11,0,0,0)
        >>> vcs.setcolorcell("AMIP",21,100,0,0)
        >>> vcs.setcolorcell("AMIP",31,0,100,0)
        >>> vcs.setcolorcell("AMIP",41,0,0,100)
        >>> vcs.setcolorcell("AMIP",51,100,100,100)
        >>> vcs.setcolorcell("AMIP",61,70,70,70)

:param obj: String name of a colormap, or a VCS object
:type obj: `str`_ or VCS object

:param num: Integer specifying which color cell to change.
    Must be from 0-239.
:type num: `int`_

:param r: Integer specifying the red value for the colorcell
:type r: `int`_

:param g: Integer specifying the green value for the colorcell
:type g: `int`_

:param b: Integer specifying the blue value for the colorcell
:type b: `int`_

:param a: Integer specifying the opacity value for the colorcell.
    Must be from 0-100.
:type a: `int`_
File:      ~/miniconda2/envs/acme_diags_env/lib/python2.7/site-packages/vcs/utils.py
Type:      function

zshaheen avatar Sep 06 '17 22:09 zshaheen