to_rgba

Documentation for eth_defi.vault_report.charts.to_rgba function.

to_rgba(colour, alpha)

Convert #rrggbb to a CSS rgba() colour.

Plotly takes rgba() strings for translucent lines, fills and markers, such as the glow under a line, the stacked TVL areas and the bubbles of the risk and return chart, while the themes define opaque hex colours.

Parameters
  • colour (str) – Hex colour.

  • alpha (float) – Opacity, 0-1.

Returns

rgba(r,g,b,a) string.

Return type

str