-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from RakuyoKit/feature/2024-07-23
Feature/2024 07 23
- Loading branch information
Showing
14 changed files
with
140 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// Gradient+Position.swift | ||
// RakuyoKit | ||
// | ||
// Created by Rakuyo on 2024/4/10. | ||
// Copyright © 2024 RakuyoKit. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Gradient.Position | ||
|
||
extension Gradient { | ||
/// Specifies the position of colors during gradient rendering. | ||
/// | ||
/// The values of this enumeration are set not according to the documentation of `startPoint`, | ||
/// but rather determined by **visual perception**. | ||
/// | ||
/// For example, if our color array is `[.red, .black, .green]` and the position is set to `from .top to .bottom`, | ||
/// the effect would be: red appears at the top of the view, and green appears at the bottom of the view. | ||
public struct Position: Hashable { | ||
public let x: CGFloat | ||
|
||
public let y: CGFloat | ||
|
||
public init(x: CGFloat, y: CGFloat) { | ||
self.x = x | ||
self.y = y | ||
} | ||
} | ||
} | ||
|
||
extension Gradient.Position { | ||
public static let top = Self(x: 0.5, y: 0.0) | ||
public static let bottom = Self(x: 0.5, y: 1.0) | ||
public static let left = Self(x: 0.0, y: 0.5) | ||
public static let right = Self(x: 1.0, y: 0.5) | ||
public static let topLeft = Self(x: 0.0, y: 0.0) | ||
public static let topRight = Self(x: 1.0, y: 0.0) | ||
public static let bottomLeft = Self(x: 0.0, y: 1.0) | ||
public static let bottomRight = Self(x: 1.0, y: 1.0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters