SourceClass Paint
from skia import Paintclass Paint:Paint controls options applied when drawing.
Constants§
Blend: Final[type]§
ClipOp: Final[type]§
FilterQuality: Final[type]§
Style: Final[type]§
TextAlign: Final[type]§
Properties§
@property
def antialias(self, /) -> bool§
@antialias.setter
def antialias(self, /, value: bool) -> None§
@property
def autohinted(self, /) -> bool§
@autohinted.setter
def autohinted(self, /, _value: bool) -> None§
@property
def blendmode(self, /) -> BlendMode |None§
@blendmode.setter
def blendmode(self, /, mode: BlendMode) -> None§
Source@property
def color(self, /) -> Color§
Retrieves alpha and RGB, unpremultiplied, packed into 32 bits.
Returns unpremultiplied ARGB.
Source@color.setter
def color(self, /, color: Any) -> None§
Sets alpha and RGB used when stroking and filling. The color is a 32-bit value, unpremultiplied, packing 8-bit components for alpha, red, blue, and green.
colorunpremultiplied ARGB
Example (C++): https://fiddle.skia.org/c/@Paint_setColor
@property
def colorfilter(self, /) -> Any |None§
@colorfilter.setter
def colorfilter(self, /, _colorfilter: Any |None) -> None§
@property
def dev_kern_text(self, /) -> bool§
@dev_kern_text.setter
def dev_kern_text(self, /, _value: bool) -> None§
@property
def dither(self, /) -> bool§
Source@dither.setter
def dither(self, /, value: bool) -> None§
Requests, but does not require, to distribute color error.
dithersetting for dithering
@property
def embedded_bitmap_text(self, /) -> bool§
@embedded_bitmap_text.setter
def embedded_bitmap_text(self, /, value: bool) -> None§
@property
def fake_bold_text(self, /) -> bool§
@fake_bold_text.setter
def fake_bold_text(self, /, value: bool) -> None§
@property
def filter_quality(self, /) -> FilterQuality§
@filter_quality.setter
def filter_quality(self, /, _quality: FilterQuality) -> None§
@property
def font(self, /) -> Font§
@font.setter
def font(self, /, font: Font) -> None§
@property
def hinting(self, /) -> FontHinting§
@hinting.setter
def hinting(self, /, hinting: FontHinting) -> None§
@property
def imagefilter(self, /) -> Any |None§
@imagefilter.setter
def imagefilter(self, /, filter: ImageFilter |None) -> None§
@property
def lcd_render_text(self, /) -> bool§
@lcd_render_text.setter
def lcd_render_text(self, /, _value: bool) -> None§
@property
def linear_text(self, /) -> bool§
@linear_text.setter
def linear_text(self, /, value: bool) -> None§
@property
def maskfilter(self, /) -> Any |None§
@maskfilter.setter
def maskfilter(self, /, _maskfilter: Any |None) -> None§
Source@property
def path_effect(self, /) -> Any |None§
Returns PathEffect if set, or None.
Does not alter PathEffect SkRefCnt.
Returns PathEffect if previously set, None otherwise.
Example (C++): https://fiddle.skia.org/c/@Paint_refPathEffect
Source@path_effect.setter
def path_effect(self, /, _effect: Any |None) -> None§
Sets PathEffect to path_effect, decreasing SkRefCnt of the previous
PathEffect. Pass None to leave the path geometry unaltered.
Increments path_effect SkRefCnt by one.
path_effectreplaceskia.Pathwith a modification when drawn
Example (C++): https://fiddle.skia.org/c/@Mask_Filter_Methods Example (C++): https://fiddle.skia.org/c/@Paint_setPathEffect
Source@property
def shader(self, /) -> Shader |None§
Returns optional colors used when filling a path, such as a gradient.
Does not alter Shader SkRefCnt.
Returns Shader if previously set, None otherwise.
Example (C++): https://fiddle.skia.org/c/@Paint_refShader
Source@shader.setter
def shader(self, /, shader: Shader |None) -> None§
Sets optional colors used when filling a path, such as a gradient.
Sets Shader to shader, decreasing SkRefCnt of the previous Shader.
Increments shader SkRefCnt by one.
shaderhow geometry is filled with color; ifNone, color is used instead
Example (C++): https://fiddle.skia.org/c/@Color_Filter_Methods Example (C++): https://fiddle.skia.org/c/@Paint_setShader
Source@property
def stroke_cap(self, /) -> StrokeCap§
Returns the geometry drawn at the beginning and end of strokes.
Source@stroke_cap.setter
def stroke_cap(self, /, cap: StrokeCap) -> None§
Sets the geometry drawn at the beginning and end of strokes.
Example (C++): https://fiddle.skia.org/c/@Paint_setStrokeCap_a Example (C++): https://fiddle.skia.org/c/@Paint_setStrokeCap_b
Source@property
def stroke_join(self, /) -> StrokeJoin§
Returns the geometry drawn at the corners of strokes.
Source@stroke_join.setter
def stroke_join(self, /, join: StrokeJoin) -> None§
Sets the geometry drawn at the corners of strokes.
Example (C++): https://fiddle.skia.org/c/@Paint_setStrokeJoin
Source@property
def stroke_miter(self, /) -> float§
Returns the limit at which a sharp corner is drawn beveled.
Returns zero and greater miter limit.
Source@stroke_miter.setter
def stroke_miter(self, /, miter: float) -> None§
When stroking a small joinAngle with miter, the miterLength may be very long. When miterLength > maxMiterLength (or joinAngle < minJoinAngle) the join will become bevel. miterLimit = maxMiterLength / strokeWidth or miterLimit = 1 / sin(minJoinAngle / 2).
This call has no effect if the miter_limit passed is less than zero.
Values less than one will be treated as bevel.
miter_limitzero and greater miter limit
Example (C++): https://fiddle.skia.org/c/@Paint_setStrokeMiter
Source@property
def stroke_width(self, /) -> float§
Returns the thickness of the pen used by Paint to
outline the shape.
Returns zero for hairline, greater than zero for pen thickness.
Source@stroke_width.setter
def stroke_width(self, /, width: float) -> None§
Sets the thickness of the pen used by the paint to outline the shape. A stroke-width of zero is treated as "hairline" width. Hairlines are always exactly one pixel wide in device space (their thickness does not change as the canvas is scaled). Negative stroke-widths are invalid; setting a negative width will have no effect.
widthzero thickness for hairline; greater than zero for pen thickness
Example (C++): https://fiddle.skia.org/c/@Miter_Limit Example (C++): https://fiddle.skia.org/c/@Paint_setStrokeWidth
Source@property
def style(self, /) -> PaintStyle§
Returns whether the geometry is filled, stroked, or filled and stroked.
Source@style.setter
def style(self, /, style: Any) -> None§
Sets whether the geometry is filled, stroked, or filled and stroked.
Has no effect if style is not a legal Style value.
Example (C++): https://fiddle.skia.org/c/@Paint_setStyle Example (C++): https://fiddle.skia.org/c/@Stroke_Width