const class gfx::Border
sys::Obj gfx::Border
@Js@Serializable { simple=true }
Modes width, style, color, and radius of a rectangular border.
- colorBottom
-
const Color colorBottom := blackColor of bottom side, default is black.
- colorLeft
-
const Color colorLeft := blackColor of left side, default is black.
- colorRight
-
const Color colorRight := blackColor of right side, default is black.
- colorTop
-
const Color colorTop := blackColor of top side, default is black.
- defVal
-
const static Border defVal := Border.fromStr("0")Default is zero pixel border.
- equals
-
virtual override Bool equals(Obj? obj)Equality is based on string format.
- fromStr
-
static new fromStr(Str str, Bool checked := true)Parse a border from string (see
toStr). If invalid and checked is true then throw ParseErr otherwise return null. The string formatted as four optional parts, where each part may have 1 to 4 values:border := [width] [style] [color] [radius] width := top ["," right ["," bottom ["," left]]] style := top ["," right ["," bottom ["," left]]] color := top ["," right ["," bottom ["," left]]] radius := top-left ["," top-right ["," bottom-right ["," bottom-left]]]
Width and radius must be integers, color must match
Colorstring format, and style must be "solid", "inset", or "outset". If one side is not specified, it is reflected from the opposite side:a => a,a,a,a a,b => a,b,a,b a,b,c => a,b,c,b
Examples:
Border("2") => 2 solid #000000 0 Border("#abc") => 1 solid #aabbcc 0 Border("2 inset 3") => 2 inset #000000 3 Border("0,1,2,3") => 0,1,2,3 solid #000000 0 Border("0,1,2 #00f") => 0,1,2 solid #0000ff 0 - hash
-
virtual override Int hash()Hash is based on string format.
- make
-
new make(|This| f)Construct with it-block
- radiusBottomLeft
-
const Int radiusBottomLeft := 0Radius in pixels of bottom-left corner, default is 0.
- radiusBottomRight
-
const Int radiusBottomRight := 0Radius in pixels of bottom-right corner, default is 0.
- radiusTopLeft
-
const Int radiusTopLeft := 0Radius in pixels of top-left corner, default is 0.
- radiusTopRight
-
const Int radiusTopRight := 0Radius in pixels of top-right corner, default is 0.
- styleBottom
-
const Int styleBottom := styleSolidStyle of bottom side as one of styleX constants, default is solid.
- styleFromStr
-
const static Int? styleFromStr(Str s, Bool checked := true)Parse style string into int constant - see
styleToStr. - styleInset
-
const static Int styleInset := 1Constant identifier for inset style.
- styleLeft
-
const Int styleLeft := styleSolidStyle of left side as one of styleX constants, default is solid.
- styleOutset
-
const static Int styleOutset := 2Constant identifier for outside style.
- styleRight
-
const Int styleRight := styleSolidStyle of right side as one of styleX constants, default is solid.
- styleSolid
-
const static Int styleSolid := 0Constant identifier for solid style.
- styleToStr
-
const static Str styleToStr(Int s)Return "solid", "inset", "outset" for int constant.
- styleTop
-
const Int styleTop := styleSolidStyle of top side as one of styleX constants, default is solid.
- toSize
-
Size toSize()Return widthRight+widthLeft, widthTop+widthBottom
- toStr
-
virtual const override Str toStrString format - see
fromStrfor format. - widthBottom
-
const Int widthBottom := 1Width in pixels of bottom side, default is 1.
- widthLeft
-
const Int widthLeft := 1Width in pixels of left side, default is 1.
- widthRight
-
const Int widthRight := 1Width in pixels of right side, default is 1.
- widthTop
-
const Int widthTop := 1Width in pixels of top side, default is 1.