Skip to content

Commit

Permalink
Added Color for gradation corresponding to Light/Dark mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanistaDev committed Dec 13, 2021
1 parent 753286e commit 0e331a4
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 3 deletions.
22 changes: 21 additions & 1 deletion SwipePageChanger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
FD7321E12767986400927135 /* Color+Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD7321E02767986400927135 /* Color+Assets.swift */; };
FDD1A47A27632DB5005D6A63 /* SwipePageChangerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDD1A47927632DB5005D6A63 /* SwipePageChangerApp.swift */; };
FDD1A47E27632DB6005D6A63 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDD1A47D27632DB6005D6A63 /* Assets.xcassets */; };
FDD1A48127632DB6005D6A63 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDD1A48027632DB6005D6A63 /* Preview Assets.xcassets */; };
Expand All @@ -19,6 +20,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
FD7321E02767986400927135 /* Color+Assets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Assets.swift"; sourceTree = "<group>"; };
FDD1A47627632DB5005D6A63 /* SwipePageChanger.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwipePageChanger.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDD1A47927632DB5005D6A63 /* SwipePageChangerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipePageChangerApp.swift; sourceTree = "<group>"; };
FDD1A47D27632DB6005D6A63 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -42,6 +44,22 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
FD7321DE2767982700927135 /* Extension */ = {
isa = PBXGroup;
children = (
FD7321E02767986400927135 /* Color+Assets.swift */,
);
path = Extension;
sourceTree = "<group>";
};
FD7321DF2767983A00927135 /* View */ = {
isa = PBXGroup;
children = (
FDD1A487276333D7005D6A63 /* Top */,
);
path = View;
sourceTree = "<group>";
};
FDD1A46D27632DB4005D6A63 = {
isa = PBXGroup;
children = (
Expand All @@ -62,7 +80,8 @@
isa = PBXGroup;
children = (
FDD1A47927632DB5005D6A63 /* SwipePageChangerApp.swift */,
FDD1A487276333D7005D6A63 /* Top */,
FD7321DF2767983A00927135 /* View */,
FD7321DE2767982700927135 /* Extension */,
FDD1A4922763D431005D6A63 /* Data */,
FDD1A47D27632DB6005D6A63 /* Assets.xcassets */,
FDD1A47F27632DB6005D6A63 /* Preview Content */,
Expand Down Expand Up @@ -170,6 +189,7 @@
files = (
FDD1A4942763D44C005D6A63 /* Constant.swift in Sources */,
FDD1A48B27634121005D6A63 /* ToolBarViewModifier.swift in Sources */,
FD7321E12767986400927135 /* Color+Assets.swift in Sources */,
FDD1A49127639CEB005D6A63 /* PageContentView.swift in Sources */,
FDD1A489276333F7005D6A63 /* TopContentView.swift in Sources */,
FDD1A47A27632DB5005D6A63 /* SwipePageChangerApp.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions SwipePageChanger/Assets.xcassets/Colors/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
12 changes: 12 additions & 0 deletions SwipePageChanger/Extension/Color+Assets.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Color+Assets.swift
// SwipePageChanger
//
// Created by Takuya Aso on 2021/12/14.
//

import SwiftUI

extension Color {
static let gradation = Color("gradationColor")
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ struct ToolBarViewModifier: ViewModifier {

}
HStack {
LinearGradient(gradient: Gradient(colors: [.white, .white.opacity(0.1)]),
LinearGradient(gradient: Gradient(colors: [.gradation, .gradation.opacity(0.1)]),
startPoint: .leading, endPoint: .trailing)
.frame(width: 8.0, height: 44.0)
Spacer()
LinearGradient(gradient: Gradient(colors: [.white.opacity(0.1), .white]),
LinearGradient(gradient: Gradient(colors: [.gradation.opacity(0.1), .gradation]),
startPoint: .leading, endPoint: .trailing)
.frame(width: 8.0, height: 44.0)
}
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 0e331a4

Please sign in to comment.