Skip to content

Commit ccc9e90

Browse files
Update add-graphics.md
1 parent 96447fd commit ccc9e90

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

programming/objectivec-swift/user-guide/capabilities/add-graphics.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,20 @@ Set the style of the highlight overlays with a user defined style:
107107
// Get the layer first.
108108
DSDrawingLayer *layer = [self.cameraView getDrawingLayer:DSDrawingLayerIdDBR];
109109
// Create a new DrawingStyle via the DrawingStyleManager.
110-
NSInteger style = [DSDrawingStyleManager createDrawingStyle:UIColor.systemTealColor strokeWidth:1.0 fillColor:[UIColor.systemTealColor colorWithAlphaComponent:0.12] textColor:UIColor.systemTealColor font:UIFontTextStyleBody];
110+
UIColor *tealColor = [[UIColor alloc] initWithRed:3/255.0 green:218/255.0 blue:197/255.0 alpha:1];
111+
UIColor *tealColorTransparent = [[UIColor alloc] initWithRed:3/255.0 green:218/255.0 blue:197/255.0 alpha:0.13];
112+
NSInteger style = [DSDrawingStyleManager createDrawingStyle:tealColor strokeWidth:1.0 fillColor:tealColorTransparent textColor:tealColor font:UIFontTextStyleBody];
111113
// Set the newly created DrawingStyle to the layer.
112114
[layer setDefaultStyle:style];
113115
```
114116
2.
115117
```swift
116118
// Get the layer first.
117-
let layer = cameraView.getDrawingLayer(DrawingLayerId.dbr)
119+
let layer = cameraView.getDrawingLayer(DrawingLayerId.DBR.rawValue)
118120
// Create a new DrawingStyle via the DrawingStyleManager.
119-
let style = DrawingStyleManager.createDrawingStyle(UIColor.systemTeal, strokeWidth: 1.0, fillColor: UIColor.systemTeal.withAlphaComponent(0.12), textColor: UIColor.systemTeal, font: UIFont.TextStyle.body)
121+
let tealColor = UIColor.init(red: 3/255.0, green: 218/255.0, blue: 197/255.0, alpha: 1)
122+
let tealColorTransparent = UIColor.init(red: 3/255.0, green: 218/255.0, blue: 197/255.0, alpha: 0.13)
123+
let style = DrawingStyleManager.createDrawingStyle(UIColor.systemTeal, strokeWidth: 1.0, fill: UIColor.systemTeal.withAlphaComponent(0.12), textColor: UIColor.systemTeal, font: UIFont.preferredFont(forTextStyle: .body))
120124
// Set the newly created DrawingStyle to the layer.
121125
layer?.setDefaultStyle(style)
122126
```

0 commit comments

Comments
 (0)