Created
February 22, 2020 21:29
-
-
Save jodyheavener/4cadd4d2cd7b1993e6dff18e462f6780 to your computer and use it in GitHub Desktop.
Creating simple Rectangles in Adobe XD, Figma, and Sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Rectangle, Color } from 'scenegraph'; | |
let rectangle = new Rectangle(); | |
rectangle.name = 'Example'; | |
rectangle.width = 100; | |
rectangle.height = 200; | |
rectangle.fill = new Color('#2345ac'); | |
rectangle.fillEnabled = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rectangle = figma.createRectangle(); | |
rectangle.name = 'Example'; | |
rectangle.resize(100, 200); | |
rectangle.fills = [{ | |
blendMode: 'NORMAL', | |
type: 'SOLID', | |
visible: true, | |
opacity: 1, | |
color: { | |
b: 0.6745098233222961, | |
g: 0.2705882489681244, | |
r: 0.13725490868091583, | |
}, | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Rectangle, Shape, Style } from 'sketch/dom'; | |
let rectangle = new Shape({ | |
name: 'Example', | |
frame: new Rectangle(0, 0, 100, 200), | |
style: { | |
fills: [{ | |
color: '#2345ac', | |
fillType: Style.FillType.Color, | |
enabled: true, | |
}], | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment