Shape
public class Shape : Layer
Represents a Shape layer in Sketch
-
Background color of the Shape
Declaration
Swift
public let backgroundColor: Color -
Thickness of the border
Declaration
Swift
public let borderWidth: CGFloat -
Color of the border
Declaration
Swift
public let borderColor: Color -
Optional gradient. If this is set then
backgroundColoris ignoredDeclaration
Swift
public let gradient: Gradient? -
If this is true then this Shape will act as a mask for all layers below it
Declaration
Swift
public let isMask: Bool -
Creates a generic Shape layer in Sketch
Declaration
Swift
public convenience init(name: String, backgroundColor: Color, bezierPath: BezierPath, borderWidth: CGFloat, borderColor: Color, isMask: Bool, gradient: Gradient?)Parameters
nameName of the Shape as it appears in Sketch
backgroundColorBackground color of the Shape
bezierPathBezierPathrepresenting the structure and posititon of the ShapeborderWidthThickness of the border
borderColorColor of the border
isMaskWether this Shape will act as a mask for all layers below it
gradientOptional. If this is not nil set then
backgroundColoris ignored -
Creates a rectangular Shape layer in Sketch. Use this to be able to surface corner radius sliders in sketch
Declaration
Swift
public convenience init(name: String, backgroundColor: Color, rectanglePath: RectanglePath, borderWidth: CGFloat, borderColor: Color, isMask: Bool, gradient: Gradient?)Parameters
nameName of the Shape as it appears in Sketch
backgroundColorBackground color of the Shape
rectanglePathRectanglePathrepresenting the structure and position of the ShapeborderWidthThickness of the border
borderColorColor of the border
isMaskthis is true then this Shape will act as a mask for all layers below it
gradientOptional. If this is not nil set then
backgroundColoris ignored
-
Declaration
Swift
public required init?(json: [String : Any])
Shape Class Reference