neoscore.core.pen
- class neoscore.core.pen.Pen[source]
Bases:
object
A pen describing how shape outlines are drawn.
- __init__(color: Optional[ColorDef] = None, thickness: Optional[Unit] = ZERO, pattern: PenPattern = PenPattern.SOLID, join_style: PenJoinStyle = PenJoinStyle.MITER, cap_style: PenCapStyle = PenCapStyle.FLAT)[source]
- Parameters
color – The stroke color. Defaults to black unless changed globally by
neoscore.set_default_color
.thickness – The stroke thickness. A value of
ZERO
(the default) indicates a display pixel width.pattern – The stroke pattern. Defaults to a solid line.
join_style – The appearance of line joints. Defaults to a bevel join
cap_style – The appearance of line ends. Defaults to a flat cap
- classmethod from_existing(pen: Pen, color: Optional[ColorDef] = None, thickness: Optional[Unit] = None, pattern: Optional[PenPattern] = None, join_style: Optional[PenJoinStyle] = None, cap_style: Optional[PenCapStyle] = None) Pen [source]
Derive a pen from another, overriding any provided fields.
- property pattern: PenPattern
The stroke pattern.
- property join_style: PenJoinStyle
The style of line sharp line joins.
This style has no effect on curved paths.
- property cap_style: PenCapStyle
the style of unclosed path caps with this pen.
This style has no effect on closed paths.
- property interface: PenInterface