Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: internalize extensions to Color #386

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside: AppKit and UIKit are almost certainly supposed to specify that dynamicProvider needs to be Sendable (see: FB16492911 & FB16492913).

@Sendable would be good to add prior to adopting the Swift 6 runtime.

init(light: @escaping @autoclosure () -> Color, dark: @escaping @autoclosure () -> Color) {
#if os(watchOS)
self = dark()
#elseif canImport(UIKit)
Expand Down