vibesketch.document.highlights¶
Atoms and bonds marked in colour, on the canvas and in figures (#91).
The canvas engine keeps no highlight in its drawing, so the document does:
a Highlight names a species, a colour
and the canonical ranks of its marked heavy atoms (RDKit’s
CanonicalRankAtoms with ties broken), which every drawing of the species
maps back to its own atoms. Bonds between two marked atoms of one highlight
are marked too, so marking a ring’s atoms marks the ring. On a symmetric
molecule a mark may land on an equivalent atom when the structure is drawn
anew, since such atoms are told apart only by their order.
The colours are Okabe and Ito’s palette for colour-vision deficiency (“Color Universal Design”, 2008, https://jfly.uni-koeln.de/color/), printed as an opaque 40 % tint on white so the line art stays legible in every journal preset and in SVG, PNG and PDF alike.
Module Attributes
Okabe and Ito's colours by name. |
Functions
|
Where the marked atoms are drawn in |
|
The species' highlights as atom indices of |
|
The printed fill of |
|
|
|
|
|
|
Exceptions
A highlight that cannot be made as asked. |
- vibesketch.document.highlights.PALETTE: dict[str, str] = {'blue': '#0072B2', 'green': '#009E73', 'orange': '#E69F00', 'purple': '#CC79A7', 'sky-blue': '#56B4E9', 'vermillion': '#D55E00'}¶
Okabe and Ito’s colours by name.
- exception vibesketch.document.highlights.HighlightRefused[source]¶
Bases:
ValueErrorA highlight that cannot be made as asked.
- vibesketch.document.highlights.highlight_points(document, ket)[source]¶
Where the marked atoms are drawn in
ket, by colour, for the canvas to show.
- vibesketch.document.highlights.marks_for(document, species, mol)[source]¶
The species’ highlights as atom indices of
mol, a drawing of it, with colours.
- vibesketch.document.highlights.tint(colour)[source]¶
The printed fill of
colour: an opaque tint, as RDKit takes colours (0 to 1).
- vibesketch.document.highlights.with_highlight(document, species, atoms, colour='orange')[source]¶
documentwithatomsofspeciesmarked, numbered from 0 as in its report.