123456789101112131415161718192021 |
- //
- // NSView+Layer.swift
- // PDF Master
- //
- // Created by lizhe on 2023/2/15.
- //
- import Foundation
- extension NSView {
- func border( _ color: NSColor = NSColor.km_init(hex: "#DFE1E5"), _ width: CGFloat = 1.0, _ cornerRaius: CGFloat = 4.0) {
- self.wantsLayer = true
- self.layer?.borderColor = color.cgColor
- self.layer?.borderWidth = width
- self.layer?.cornerRadius = cornerRaius
- }
-
- func backgroundColor(_ color: NSColor = NSColor.km_init(hex: "#FFFFFF")) {
- self.wantsLayer = true
- self.layer?.backgroundColor = color.cgColor
- }
- }
|