<!--
{
  "availability" : [
    "macOS: 10.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextBlock/setBorderColor(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextBlock(im)setBorderColor:forEdge:"
  },
  "title" : "setBorderColor(_:for:)"
}
-->

# setBorderColor(_:for:)

Sets the border color of the specified edge of the text block.

```
func setBorderColor(_ color: NSColor?, for edge: NSRectEdge)
```

## Parameters

`color`

The new color.

`edge`

The edge whose color is to be set.

## Discussion

This setting has no visible effect unless the border width is larger than the default, which is 0.

## See Also

[`-  setWidth:type:forLayer:`](/documentation/AppKit/NSTextBlock/setWidth(_:type:for:))

Sets the width of all edges of a specified layer of the text block.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)