biopython v1.71.0 Bio.Phylo.BaseTree.BranchColor

Indicates the color of a clade when rendered graphically.

The color should be interpreted by client code (e.g. visualization programs) as applying to the whole clade, unless overwritten by the color(s) of sub-clades.

Color values must be integers from 0 to 255.

Link to this section Summary

Functions

Initialize BranchColor for a tree

Preserve the standard RGB order when representing this object

Show the color’s RGB values

Construct a BranchColor object from a hexadecimal string

Construct a BranchColor object by the color’s name

Return a 24-bit hexadecimal RGB representation of this color

Return a tuple of RGB values (0 to 255) representing this color

Link to this section Functions

Initialize BranchColor for a tree.

Preserve the standard RGB order when representing this object.

Show the color’s RGB values.

Construct a BranchColor object from a hexadecimal string.

The string format is the same style used in HTML and CSS, such as ‘

Construct a BranchColor object by the color’s name.

Return a 24-bit hexadecimal RGB representation of this color.

The returned string is suitable for use in HTML/CSS, as a color parameter in matplotlib, and perhaps other situations.

Example:

     >>> bc = BranchColor(12, 200, 100)
     >>> bc.to_hex()
     '

Return a tuple of RGB values (0 to 255) representing this color.

Example:

     >>> bc = BranchColor(255, 165, 0)
     >>> bc.to_rgb()
     (255, 165, 0)