Skip to content

Alpha channel for color of Text Objects does not work; RGB values non-standard #432

@davis278

Description

@davis278

Though the documentation and the VCS Text Objects notebook (https://github.com/CDAT/Jupyter-notebooks/tree/master/vcs/VCS_Text_Objects or https://cdat.llnl.gov/Jupyter-notebooks/vcs/VCS_Text_Objects/VCS_Text_Objects.html) state that a color can be specified with RGB[a] values, the alpha channel [a] does not work and the RGB "values" are non-standard - they appear to be percentages between 0 and 100 rather than the more common numeric value between 0 and 255.

For the Alpha channel:
I tried the following code as an old text objects notebook suggests (https://github.com/CDAT/vcs/blob/master/docs/Jupyter/Text_Objects.ipynb), but could not get the alpha channel to work.

import vcs
txt = vcs.createtext()
txt.string = 'A VCS Text Object'
txt.color = (100,0,0,25)
canvas.plot(txt)

I tried the following but none of them worked:
txt.color = (100,0,0,0.25)
txt.color = (100,0,0,.25)
txt.color = [100,0,0,25]

For the RGB portion of the issue, I tried:
txt.color = (255,0,0,25)
but this leads to an error that says that values cannot exceed 100.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions