Skip to content

Commit e0f68cc

Browse files
Updated to v1.0.4
Fixed some light/dark mode issues on iOS 13-14 Refactored UI layout code Updated project for modern theos installations
1 parent 15fee72 commit e0f68cc

16 files changed

Lines changed: 164 additions & 99 deletions

CSColorPicker Resources/CSColorPicker/UIColor+CSColorPicker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Copyright (c) 2016 - 2019 CreatureCoding. All rights reserved.
44
//
55

6+
#import <UIKit/UIKit.h>
7+
68
@interface UIColor (CSColorPicker)
79

810
//
35.8 KB
Binary file not shown.

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
ARCHS = armv7 armv7s arm64 arm64e
2-
TARGET = iphone:clang:11.2:5.0
2+
TARGET = iphone:clang:13.0:5.0
33

44
GO_EASY_ON_ME = 0
55
FINALPACKAGE = 1
66
DEBUG = 0
77

8+
PREFIX = $(THEOS)/toolchains/xcode11.xctoolchain/usr/bin/
9+
INSTALL_TARGET_PROCESSES = Preferences
10+
811
include $(THEOS)/makefiles/common.mk
912

1013
INCLUDES = $(THEOS_PROJECT_DIR)/source
@@ -15,7 +18,7 @@ $(LIBRARY_NAME)_FRAMEWORKS = UIKit CoreGraphics CoreFoundation
1518
$(LIBRARY_NAME)_PRIVATE_FRAMEWORKS = Preferences
1619
$(LIBRARY_NAME)_CFLAGS += -fobjc-arc -I$(INCLUDES) -IPrefix.pch
1720

18-
after-install::
19-
install.exec "killall -9 Preferences"
20-
2121
include $(THEOS_MAKE_PATH)/library.mk
22+
23+
# SUBPROJECTS += lcpshim
24+
# include $(THEOS_MAKE_PATH)/aggregate.mk

control

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
Package: com.creaturesurvive.libcscolorpicker
22
Name: libCSColorPicker
3-
Version: 1.0.1
3+
Pre-Depends: firmware (>= 7.0)
4+
Version: 1.0.4
45
Architecture: iphoneos-arm
5-
Depiction: https://creaturecoding.com/?page=depiction&id=libcscolorpicker
66
Description: A minimal color picker library for developers
77
Maintainer: CreatureSurvive <support@creaturecoding.com>
88
Author: CreatureSurvive <support@creaturecoding.com>
99
Section: System
10+
Homepage: https://creaturecoding.com/
11+
Depiction: https://creaturecoding.com/?page=depiction&id=libcscolorpicker
12+
SileoDepiction: https://creaturecoding.com/sileo/depiction/?package_id=libcscolorpicker
13+
Tag: purpose::extension, compatible_min::iosiOS7
14+

source/Categories/UIColor+CSColorPicker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Created by CreatureSurvive on 3/17/17.
33
// Copyright (c) 2016 - 2019 CreatureCoding. All rights reserved.
44
//
5+
#import <UIKit/UIKit.h>
56

67
@interface UIColor (CSColorPicker)
78

source/Cells/CSColorDisplayCell.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55

66
#import <Cells/CSColorDisplayCell.h>
7+
#import <Prefix.h>
78

89
@implementation CSColorDisplayCell
910
@synthesize cellColorDisplay;

source/Cells/CSGradientDisplayCell.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55

66
#import <Cells/CSGradientDisplayCell.h>
7+
#import <Prefix.h>
78

89
@implementation CSGradientDisplayCell
910
@synthesize cellColorDisplay, gradient;

source/Controllers/CSColorPickerViewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
@property (nonatomic, strong) CSColorPickerBackgroundView *colorPickerBackgroundView;
2626
@property (nonatomic, strong) UIView *colorPickerPreviewView;
2727
@property (nonatomic, strong) CSGradientSelection *gradientSelection;
28+
@property (nonatomic, strong) UIVisualEffectView *topBackdrop;
29+
@property (nonatomic, strong) UIVisualEffectView *bottomBackdrop;
2830

2931
@property (nonatomic, retain) CSColorSlider *colorPickerHueSlider;
3032
@property (nonatomic, retain) CSColorSlider *colorPickerSaturationSlider;

source/Controllers/CSColorPickerViewController.m

Lines changed: 110 additions & 76 deletions
Large diffs are not rendered by default.

source/Controls/CSColorSlider.m

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55

66
#import <Controls/CSColorSlider.h>
7+
#import <Prefix.h>
78

89
@interface CSColorSlider ()
910

@@ -60,7 +61,7 @@ - (void)baseInitWithType:(CSColorSliderType)sliderType label:(NSString *)label s
6061
[self.sliderLabel setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:16]];
6162
[self.sliderLabel setText:label];
6263
[self.sliderLabel setBackgroundColor:[UIColor clearColor]];
63-
[self.sliderLabel setTextColor:[UIColor blackColor]];
64+
[self.sliderLabel setTextColor:[UIColor respondsToSelector:@selector(labelColor)] ? [UIColor performSelector:@selector(labelColor)] : [UIColor blackColor]];
6465
[self.sliderLabel setTextAlignment:NSTextAlignmentLeft];
6566
[self insertSubview:self.sliderLabel atIndex:0];
6667
[self.sliderLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
@@ -73,20 +74,13 @@ - (void)baseInitWithType:(CSColorSliderType)sliderType label:(NSString *)label s
7374
[self.sliderValueLabel setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:16]];
7475
[self.sliderValueLabel setText:@"0"];
7576
[self.sliderValueLabel setBackgroundColor:[UIColor clearColor]];
76-
[self.sliderValueLabel setTextColor:[UIColor blackColor]];
77+
[self.sliderValueLabel setTextColor:[UIColor respondsToSelector:@selector(labelColor)] ? [UIColor performSelector:@selector(labelColor)] : [UIColor blackColor]];
7778
[self.sliderValueLabel setTextAlignment:NSTextAlignmentRight];
7879
[self insertSubview:self.sliderValueLabel atIndex:0];
7980
[self.sliderValueLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
8081
[self addConstraint:[NSLayoutConstraint constraintWithItem:self.sliderValueLabel attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:0.5 constant:0]];
8182
[self addConstraint:[NSLayoutConstraint constraintWithItem:self.sliderValueLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:0.98 constant:0]];
8283

83-
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
84-
UIVisualEffectView *cellBackgroundBlur = [[UIVisualEffectView alloc] initWithEffect:effect];
85-
cellBackgroundBlur.frame = self.bounds;
86-
cellBackgroundBlur.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
87-
cellBackgroundBlur.userInteractionEnabled = NO;
88-
[self insertSubview:cellBackgroundBlur atIndex:0];
89-
9084
self.sliderType = sliderType;
9185
self.selectedColor = startColor;
9286

0 commit comments

Comments
 (0)