Documentation ¶
Overview ¶
Package render provides functionality to render images suitable for display on a limited size screen.
This package was originally developed with the Inky pHAT device in mind; its display is 212x104 pixels and supports up to three colors depending on the particular model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SubwayClock ¶
func SubwayClock(update models.FeedUpdate, stopID string, northLabel string, southLabel string) *image.RGBA
SubwayClock renders an image suitable for display as a subway clock. The output will be an image, 212 x 104, that has two sections: one for the stop in the "southbound" direction on the top section and one for the "northbound" direction in the bottom row.
Each section will be labelled with the input text labels. Below the text, this function will render the minutes until the next few trains will arrive, rounded up to the nearest minute.
If a train is about to arrive, it may render 0. Depending on the last update time, it is possible that some trains may have already departed. In that case, those trains will be skipped.
Types ¶
This section is empty.