BorderSide
Creates the side of a border.
By default, the border is 1.0 logical pixels wide and solid black color.
To omit (not show) a side, set style to flet.BorderStyle.NONE. It skips painting the border, but the border still has a width.
Properties
color- The color of this side of the border.stroke_align- The relative position of the stroke on aBorderSidein anOutlinedBorderorBorder.stroke_inset- The amount of the stroke width that lies inside thisBorderSide.stroke_offset- The offset of the stroke, taking into account the stroke alignment.stroke_outset- The amount of the stroke width that lies outside thisBorderSide.style- The style of this side of the border.width- The width of this side of the border, in logical pixels.
Methods
Properties
colorclass-attributeinstance-attribute
color: ColorValue = Colors.BLACKThe color of this side of the border.
stroke_alignclass-attributeinstance-attribute
stroke_align: BorderSideStrokeAlignValue = BorderSideStrokeAlign.INSIDEThe relative position of the stroke on a BorderSide in an OutlinedBorder or Border.
stroke_insetproperty
The amount of the stroke width that lies inside this BorderSide.
For example, this will return the width for a stroke_align
of -1, half the width for a stroke_align of 0, and 0
for a stroke_align of 1.
stroke_offsetproperty
The offset of the stroke, taking into account the stroke alignment.
For example, this will return the negative width of the stroke for a stroke_align of -1, 0 for a stroke_align of 0, and the width for a stroke_align of -1.
stroke_outsetproperty
The amount of the stroke width that lies outside this BorderSide.
For example, this will return 0 for a stroke_align of -1, half the
width for a stroke_align of 0, and the width
for a stroke_align of 1.
styleclass-attributeinstance-attribute
style: BorderStyle = BorderStyle.SOLIDThe style of this side of the border.
widthclass-attributeinstance-attribute
width: Number = 1.0The width of this side of the border, in logical pixels.
Setting width to 0.0 will result in a hairline border. This means that the border will have the width of one physical pixel. Hairline rendering takes shortcuts when the path overlaps a pixel more than once. This means that it will render faster than otherwise, but it might double-hit pixels, giving it a slightly darker/lighter result.
To omit the border entirely, set the style to flet.BorderStyle.NONE.
Raises:
- ValueError - If it is not greater than or equal to
0.
Methods
copy
copy(width: Optional[Number] = None, color: Optional[ColorValue] = None, stroke_align: Optional[BorderSideStrokeAlignValue] = None)Returns a copy of this object with the specified properties overridden.
nonestaticmethod
none()Creates a border side that is not rendered.
Returns:
- BorderSide - A hairline black BorderSide with style set to flet.BorderStyle.NONE.