Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed May 30, 2024
1 parent 28f5141 commit e853256
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Osmium.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
Base,
);
mainGroup = 13177F262C0645A800E4CECA;
packageReferences = (
137A738E2C08E81F00255254 /* XCRemoteSwiftPackageReference "ColorfulX" */,
);
productRefGroup = 13177F302C0645A900E4CECA /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -424,6 +427,17 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
137A738E2C08E81F00255254 /* XCRemoteSwiftPackageReference "ColorfulX" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Lakr233/ColorfulX.git";
requirement = {
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */
};
rootObject = 13177F272C0645A800E4CECA /* Project object */;
}
16 changes: 16 additions & 0 deletions Osmium/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import ColorfulX

class ViewController: UIViewController, UITextFieldDelegate {

Expand All @@ -23,6 +24,21 @@ class ViewController: UIViewController, UITextFieldDelegate {
override func viewDidLoad() {
super.viewDidLoad()

// Create a static gradient with gray background
let gradientView = MulticolorGradientView()
gradientView.parameters = .init(points: [
.init(color: .init(r: 0.5, g: 0.5, b: 0.5), position: .init(x: 0, y: 0)), // Dark gray
.init(color: .init(r: 0.75, g: 0.75, b: 0.75), position: .init(x: 1, y: 0)), // Light gray
.init(color: .init(r: 0.5, g: 0.5, b: 0.5), position: .init(x: 0, y: 1)), // Dark gray
.init(color: .init(r: 0.75, g: 0.75, b: 0.75), position: .init(x: 1, y: 1)) // Light gray
], bias: 0.01, power: 2, noise: 32)

// Add the gradient view to the main view
gradientView.frame = self.view.bounds
gradientView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
self.view.addSubview(gradientView)
self.view.sendSubviewToBack(gradientView)

consoleTextView.text = "Console Output:"
consoleTextView.layer.cornerRadius = 16
consoleTextView.layer.masksToBounds = true
Expand Down

0 comments on commit e853256

Please sign in to comment.