Skip to content

Generating a TriadScheme but cannot access individual RGB values from the tuple #12

@deronsizemore

Description

@deronsizemore

For the moment, I'm attempting to get triadic colors for another color.

hex_to_rgb = Color.HtmlToRgb(color.color)
create_triad = Color.NewFromRgb(*hex_to_rgb).TriadicScheme(angle=120, mode='ryb')

So I've got a hex value which I'm first converting to RGB. Then, taking that converted RGB value and creating triadic colors (two colors based off the original color). When I print create_triad I get:

((0.831372549019608, 0.168627450980392, 0.2850631808278856, 1.0), (0.831372549019608, 0.8088366013071899, 0.168627450980392, 1.0))

So it's a nested tuple containing RGB values.

I can do:

print create_triad[0]

which gets me:

(0.831372549019608, 0.168627450980392, 0.2850631808278856, 1.0)

So what I need is a way to access the individual values inside of this tuple. I thought I could simply do:

print create_triad[0][0]

But that gives me:

Color instance has no attribute 'getitem'

Full traceback: http://dpaste.com/2JQF235

Would appreciate any help someone could offer up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions