@classmethod
def from_gs(cls, graphics):
    """Creates a new StrokeState from a ColoredState object."""
    ret = cls()
    ret.color = graphics.stroke_color
    ret.linewidth = graphics.linewidth
    ret.linecap = graphics.linecap
    ret.linejoin = graphics.linejoin
    ret.miterlimit = graphics.miterlimit
    ret.dash = graphics.dash
    return ret
