diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index ed70b3c..5f8bdb0 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ 04FC95D72EB1EA16007BD342 /* BaseTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95D62EB1EA16007BD342 /* BaseTableView.m */; }; 04FC95D82EB1EA16007BD342 /* BaseCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95D42EB1EA16007BD342 /* BaseCell.m */; }; 04FC95DD2EB202A3007BD342 /* KBGuideVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95DC2EB202A3007BD342 /* KBGuideVC.m */; }; + 04FC95E52EB220B5007BD342 /* UIColor+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95E42EB220B5007BD342 /* UIColor+Extension.m */; }; 04FC97002EB30A00007BD342 /* KBGuideTopCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC96FF2EB30A00007BD342 /* KBGuideTopCell.m */; }; 04FC97032EB30A00007BD342 /* KBGuideKFCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC97022EB30A00007BD342 /* KBGuideKFCell.m */; }; 04FC97062EB30A00007BD342 /* KBGuideUserCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC97052EB30A00007BD342 /* KBGuideUserCell.m */; }; @@ -115,6 +116,8 @@ 04FC95D62EB1EA16007BD342 /* BaseTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseTableView.m; sourceTree = ""; }; 04FC95DB2EB202A3007BD342 /* KBGuideVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBGuideVC.h; sourceTree = ""; }; 04FC95DC2EB202A3007BD342 /* KBGuideVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBGuideVC.m; sourceTree = ""; }; + 04FC95E32EB220B5007BD342 /* UIColor+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extension.h"; sourceTree = ""; }; + 04FC95E42EB220B5007BD342 /* UIColor+Extension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extension.m"; sourceTree = ""; }; 04FC96FE2EB30A00007BD342 /* KBGuideTopCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBGuideTopCell.h; sourceTree = ""; }; 04FC96FF2EB30A00007BD342 /* KBGuideTopCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBGuideTopCell.m; sourceTree = ""; }; 04FC97012EB30A00007BD342 /* KBGuideKFCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBGuideKFCell.h; sourceTree = ""; }; @@ -332,6 +335,7 @@ 04FC95BF2EB1E3B1007BD342 /* Class */ = { isa = PBXGroup; children = ( + 04FC95E22EB2208F007BD342 /* Categories */, 04FC95E12EB20AD1007BD342 /* Guard */, 04FC95C62EB1E4AB007BD342 /* Base */, 04FC95BA2EB1E3B1007BD342 /* Main */, @@ -417,6 +421,15 @@ path = Guard; sourceTree = ""; }; + 04FC95E22EB2208F007BD342 /* Categories */ = { + isa = PBXGroup; + children = ( + 04FC95E32EB220B5007BD342 /* UIColor+Extension.h */, + 04FC95E42EB220B5007BD342 /* UIColor+Extension.m */, + ); + path = Categories; + sourceTree = ""; + }; 2C53A0856097DCFBE7B55649 /* Pods */ = { isa = PBXGroup; children = ( @@ -665,6 +678,7 @@ 04FC95D82EB1EA16007BD342 /* BaseCell.m in Sources */, 04FC95C92EB1E4C9007BD342 /* BaseNavigationController.m in Sources */, 04FC95DD2EB202A3007BD342 /* KBGuideVC.m in Sources */, + 04FC95E52EB220B5007BD342 /* UIColor+Extension.m in Sources */, 04FC97002EB30A00007BD342 /* KBGuideTopCell.m in Sources */, 04FC97032EB30A00007BD342 /* KBGuideKFCell.m in Sources */, 04FC97062EB30A00007BD342 /* KBGuideUserCell.m in Sources */, diff --git a/keyBoard/Class/Categories/UIColor+Extension.h b/keyBoard/Class/Categories/UIColor+Extension.h new file mode 100644 index 0000000..2584919 --- /dev/null +++ b/keyBoard/Class/Categories/UIColor+Extension.h @@ -0,0 +1,16 @@ +// +// UIColor+Extension.h +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIColor (Extension) ++ (UIColor *)colorWithHex:(int)hexValue; +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Categories/UIColor+Extension.m b/keyBoard/Class/Categories/UIColor+Extension.m new file mode 100644 index 0000000..c7349da --- /dev/null +++ b/keyBoard/Class/Categories/UIColor+Extension.m @@ -0,0 +1,23 @@ +// +// UIColor+Extension.m +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import "UIColor+Extension.h" + +@implementation UIColor (Extension) ++ (UIColor *)colorWithHex:(int)hexValue alpha:(CGFloat)alpha +{ + return [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16))/255.0 + green:((float)((hexValue & 0xFF00) >> 8))/255.0 + blue:((float)(hexValue & 0xFF))/255.0 + alpha:alpha]; +} + ++ (UIColor *)colorWithHex:(int)hexValue +{ + return [UIColor colorWithHex:hexValue alpha:1.0]; +} +@end