module timelinelib.canvas.drawing.utils

class timelinelib.canvas.drawing.utils.Metrics[source]

Bases: object

Convert between pixel coordinates and time coordinates.

__init__(size, time_type, time_period, divider_line_slider)[source]

Initialize self. See help(type(self)) for accurate signature.

calc_exact_x(time)[source]

Return the x position in pixels as a float for the given time.

calc_x(time)[source]

Return the x position in pixels as an integer for the given time.

calc_exact_width(time_period)[source]

Return the with in pixels as a float for the given time_period.

calc_width(time_period)[source]

Return the with in pixels as an integer for the given time_period.

get_time(x)[source]

Return the time at pixel x.

get_difftime(x1, x2)[source]

Return the time length between two x positions.

timelinelib.canvas.drawing.utils.darken_color(color, factor=0.7)[source]
timelinelib.canvas.drawing.utils.lighten_color(color, factor=1.5)[source]
timelinelib.canvas.drawing.utils.get_colour(rgb_tuple)[source]
timelinelib.canvas.drawing.utils.black_solid_pen(size)[source]
timelinelib.canvas.drawing.utils.black_solid_brush()[source]