diff --git a/Sources/SkipUI/SkipUI/Color/Color.swift b/Sources/SkipUI/SkipUI/Color/Color.swift index 8996a7dc..e958335e 100644 --- a/Sources/SkipUI/SkipUI/Color/Color.swift +++ b/Sources/SkipUI/SkipUI/Color/Color.swift @@ -57,9 +57,9 @@ public struct Color: View, Hashable, Sendable { fatalError() } #endif -} -extension Color { + // MARK: - + public enum RGBColorSpace : Hashable, Sendable { case sRGB case sRGBLinear @@ -91,9 +91,9 @@ extension Color { colorImpl = { androidx.compose.ui.graphics.Color.hsl(hue: Float(hue), saturation: Float(saturation), lightness: Float(brightness), alpha: Float(opacity)) } #endif } -} -extension Color { + // MARK: - + public struct Resolved : Hashable { public var red: Float public var green: Float @@ -121,9 +121,9 @@ extension Color { public init(_ resolved: Color.Resolved) { self.init(red: Double(resolved.red), green: Double(resolved.green), blue: Double(resolved.blue), opacity: Double(resolved.opacity)) } -} -extension Color { + // MARK: - + public static var accentColor: Color { #if SKIP return Color(colorImpl: { MaterialTheme.colorScheme.primary }) @@ -131,10 +131,8 @@ extension Color { fatalError() #endif } -} -#if SKIP -extension Color { + #if SKIP public static let clear = Color(colorImpl: { androidx.compose.ui.graphics.Color.Transparent }) @@ -200,28 +198,26 @@ extension Color { public static let brown = Color(colorImpl: { color(light: 0xFFA2845E, dark: 0xFFAC8E68) }) -} -#endif + #endif + + // MARK: - -extension Color { @available(*, unavailable) public init(_ name: String, bundle: Any? = nil /* Bundle? = nil */) { #if SKIP colorImpl = { androidx.compose.ui.graphics.Color.White } #endif } -} -extension Color { @available(*, unavailable) public init(uiColor: Any /* UIColor */) { #if SKIP colorImpl = { androidx.compose.ui.graphics.Color.White } #endif } -} -extension Color { + // MARK: - + public func opacity(_ opacity: Double) -> Color { #if SKIP return Color(colorImpl: { @@ -232,9 +228,9 @@ extension Color { return self #endif } -} -extension Color { + // MARK: - + @available(*, unavailable) public var gradient: Any /* AnyGradient */ { fatalError() diff --git a/Sources/SkipUI/SkipUI/Containers/List.swift b/Sources/SkipUI/SkipUI/Containers/List.swift index 23af1cd8..08b39e89 100644 --- a/Sources/SkipUI/SkipUI/Containers/List.swift +++ b/Sources/SkipUI/SkipUI/Containers/List.swift @@ -163,6 +163,12 @@ public struct List : View where SelectionValue: Hashabl stubView() } #endif + + // MARK: - + + public init(_ data: Range, @ViewBuilder rowContent: @escaping (Int) -> Content) { + self.init(indexRange: data, indexedContent: rowContent) + } } /// Adopted by views that adapt when used as a list item. @@ -173,12 +179,6 @@ protocol ListItemAdapting { #endif } -extension List { - public init(_ data: Range, @ViewBuilder rowContent: @escaping (Int) -> Content) { - self.init(indexRange: data, indexedContent: rowContent) - } -} - // Kotlin does not support generic constructor parameters, so we have to model many List constructors as functions #if SKIP