Skip to content

Commit

Permalink
internalize extensions to Color
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cweider committed Feb 12, 2025
1 parent a9c7615 commit 35c104a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/MarkdownUI/Utility/Color+RGBA.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 35c104a

Please sign in to comment.