IHColorPickerView.m 572 B

123456789101112131415161718192021222324252627
  1. //
  2. // IHColorPickerView.m
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2020/4/17.
  6. // Copyright © 2020 weclouds. All rights reserved.
  7. //
  8. #import "IHColorPickerView.h"
  9. #import "HSBSupport.h"
  10. @interface IHColorPickerView()
  11. @end
  12. @implementation IHColorPickerView
  13. -(void)drawRect:(CGRect)rect{
  14. float hsv[] = {0.0,1.0,1.0};
  15. CGImageRef image = createHSVBarContentImage(InfComponentIndexHue,hsv);
  16. if (image) {
  17. CGContextRef ctx = UIGraphicsGetCurrentContext();
  18. CGContextDrawImage(ctx, rect, image);
  19. CGImageRelease(image);
  20. }
  21. }
  22. @end