HXPhotoEditConfiguration.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // HXPhotoEditConfiguration.m
  3. // photoEditDemo
  4. //
  5. // Created by Silence on 2020/7/6.
  6. // Copyright © 2020 Silence. All rights reserved.
  7. //
  8. #import "HXPhotoEditConfiguration.h"
  9. #import "UIColor+HXExtension.h"
  10. @implementation HXPhotoEditConfiguration
  11. - (instancetype)init {
  12. self = [super init];
  13. if (self) {
  14. self.maximumLimitTextLength = 0;
  15. self.supportRotation = YES;
  16. self.clippingMinSize = CGSizeMake(80, 80);
  17. self.supportedInterfaceOrientations = UIInterfaceOrientationMaskPortrait;
  18. }
  19. return self;
  20. }
  21. - (CGFloat)brushLineMaxWidth {
  22. if (!_brushLineMaxWidth) {
  23. _brushLineMaxWidth = 12.f;
  24. }
  25. return _brushLineMaxWidth;
  26. }
  27. - (CGFloat)brushLineMinWidth {
  28. if (!_brushLineMinWidth) {
  29. _brushLineMinWidth = 3.f;
  30. }
  31. return _brushLineMinWidth;
  32. }
  33. - (UIColor *)themeColor {
  34. if (!_themeColor) {
  35. _themeColor = [UIColor hx_colorWithHexStr:@"#07C160"];
  36. }
  37. return _themeColor;
  38. }
  39. - (NSArray<UIColor *> *)drawColors {
  40. if (!_drawColors) {
  41. _drawColors = @[[UIColor hx_colorWithHexStr:@"#ffffff"], [UIColor hx_colorWithHexStr:@"#2B2B2B"], [UIColor hx_colorWithHexStr:@"#FA5150"], [UIColor hx_colorWithHexStr:@"#FEC200"], [UIColor hx_colorWithHexStr:@"#07C160"], [UIColor hx_colorWithHexStr:@"#10ADFF"], [UIColor hx_colorWithHexStr:@"#6467EF"]];
  42. self.defaultDarwColorIndex = 2;
  43. }
  44. return _drawColors;
  45. }
  46. - (NSArray<UIColor *> *)textColors {
  47. if (!_textColors) {
  48. _textColors = @[[UIColor hx_colorWithHexStr:@"#ffffff"], [UIColor hx_colorWithHexStr:@"#2B2B2B"], [UIColor hx_colorWithHexStr:@"#FA5150"], [UIColor hx_colorWithHexStr:@"#FEC200"], [UIColor hx_colorWithHexStr:@"#07C160"], [UIColor hx_colorWithHexStr:@"#10ADFF"], [UIColor hx_colorWithHexStr:@"#6467EF"]];
  49. }
  50. return _textColors;
  51. }
  52. - (UIFont *)textFont {
  53. if (!_textFont) {
  54. _textFont = [UIFont boldSystemFontOfSize:25];
  55. }
  56. return _textFont;
  57. }
  58. - (NSArray<HXPhotoEditChartletTitleModel *> *)chartletModels {
  59. if (!_chartletModels) {
  60. HXPhotoEditChartletTitleModel *netModel = [HXPhotoEditChartletTitleModel modelWithImageNamed:@"hx_sticker_cover"];
  61. NSArray *imageNames = @[@"chongya", @"jintianfenkeai", @"keaibiaoq", @"saihong", @"xiaochuzhujiao", @"yuanqimanman", @"yuanqishaonv", @"zaizaijia", @"haoxinqing", @"housailei", @"kehaixing", @"wow", @"woxiangfazipai" ];
  62. NSMutableArray *models = [NSMutableArray array];
  63. for (NSString *imageNamed in imageNames) {
  64. HXPhotoEditChartletModel *subModel = [HXPhotoEditChartletModel modelWithImageNamed:[NSString stringWithFormat:@"hx_sticker_%@", imageNamed]];
  65. [models addObject:subModel];
  66. }
  67. netModel.models = models.copy;
  68. _chartletModels = @[netModel];
  69. }
  70. return _chartletModels;
  71. }
  72. @end