TOSettingsKeypadImage.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // TOSettingsKeypadImage.h
  3. //
  4. // Copyright 2017 Timothy Oliver. All rights reserved.
  5. //
  6. // Permission is hereby granted, free of charge, to any person obtaining a copy
  7. // of this software and associated documentation files (the "Software"), to
  8. // deal in the Software without restriction, including without limitation the
  9. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. // sell copies of the Software, and to permit persons to whom the Software is
  11. // furnished to do so, subject to the following conditions:
  12. //
  13. // The above copyright notice and this permission notice shall be included in
  14. // all copies or substantial portions of the Software.
  15. //
  16. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20. // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
  21. // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. #import <UIKit/UIKit.h>
  23. NS_ASSUME_NONNULL_BEGIN
  24. /**
  25. A subclass of `UIImage` that procedurally generates images for `TOPasscodeSettingsKeypadView`.
  26. This includes background images for each keypad button, and a delete icon for the bottom right corner
  27. of the keypad.
  28. */
  29. @interface TOSettingsKeypadImage : UIImage
  30. /**
  31. Generates and returns an image of button background with a raised border in a pseudo-skeuomorphic style.
  32. @param radius The rounded radius of the button image's corners
  33. @param foregroundColor The fill color of the primary section of the button
  34. @param edgeColor The color of the raised border edge along the bottom.
  35. @param thickness The size of the border running along the bottom
  36. */
  37. + (UIImage *)buttonImageWithCornerRadius:(CGFloat)radius
  38. foregroundColor:(UIColor *)foregroundColor
  39. edgeColor:(UIColor *)edgeColor
  40. edgeThickness:(CGFloat)thickness;
  41. /**
  42. Generates and returns a tintable delete icon.
  43. */
  44. + (UIImage *)deleteIcon;
  45. @end
  46. NS_ASSUME_NONNULL_END