Set colors

Allow a short tutorial on changing the color, of for instance the background of your control. The code itself is a little wordy, but we are improving this shortly.

Setting background color programmatically

The key is to use the getStyle method and define the style type:

import ScadeKit

class MainPageAdapter: SCDLatticePageAdapter {

	// page adapter initialization
	override func load(_ path: String) {		
		// too wordy but it works. Refining the API soon
		let tmpBackground = SCDWidgetsBackgroundStyle()
		let style =!.getStyle(tmpBackground.eClass()) as! SCDWidgetsBackgroundStyle
		style.type = SCDWidgetsBackgroundType.color		
		style.color = SCDGraphicsRGB(red:39,blue:100,green:130)

Set colors