From 86b7b0565b5f6243224237dbd25555d7f546291c Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Tue, 11 Feb 2025 17:15:43 -0800 Subject: [PATCH] feat: internalize extensions to `Color` The initializers `init(rgba:)` and `init(light:dark:)`, introduced in #168 are very useful, but should be `internal`. Marked as `public`, these functions are liable to cause conflicts with other packages. The potential for conflict is heightened by the functions' utility and the intuitive name. --- Sources/MarkdownUI/Utility/Color+RGBA.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MarkdownUI/Utility/Color+RGBA.swift b/Sources/MarkdownUI/Utility/Color+RGBA.swift index 583e9a4c..5e3390e5 100644 --- a/Sources/MarkdownUI/Utility/Color+RGBA.swift +++ b/Sources/MarkdownUI/Utility/Color+RGBA.swift @@ -3,7 +3,7 @@ import SwiftUI extension Color { /// Creates a constant color from an RGBA value. /// - Parameter rgba: A 32-bit value that represents the red, green, blue, and alpha components of the color. - public init(rgba: UInt32) { + init(rgba: UInt32) { self.init( red: CGFloat((rgba & 0xff00_0000) >> 24) / 255.0, green: CGFloat((rgba & 0x00ff_0000) >> 16) / 255.0, @@ -16,7 +16,7 @@ extension Color { /// - Parameters: /// - light: The light appearance color value. /// - dark: The dark appearance color value. - public init(light: @escaping @autoclosure () -> Color, dark: @escaping @autoclosure () -> Color) { + init(light: @escaping @autoclosure () -> Color, dark: @escaping @autoclosure () -> Color) { #if os(watchOS) self = dark() #elseif canImport(UIKit)