如何更改图像中红色的默认色调?

时间:2012-01-06 11:07:50

标签: iphone

在我的应用程序中,我需要更换一种颜色,我使用颜色选择器来做它。对于一件红色衬衫,我需要应用颜色,它不完全正常工作,并出现深色阴影。我们可以改变红色的色调与拾取器颜色兼容?这是我的代码

    imageLayer = [CALayer layer];
    NSLog(@"imageLayer %@",imageLayer);
    NSLog(@"self.layer %@",self.layer);
    imageLayer.frame = CGRectMake(0, 0, 660, 1000);
    imageLayer.cornerRadius = 10.0;
    imageLayer.backgroundColor = [UIColor clearColor].CGColor;
    //imageLayer.contents = (id) [UIImage imageNamed:@"3.png"].CGImage;
    imageLayer.masksToBounds = YES;
    [self.layer addSublayer:imageLayer];
    subLayer = [CALayer layer];
    subLayer.frame = CGRectMake(0, 0, 660, 1000);
    subLayer.cornerRadius = 10.0;
    subLayer.backgroundColor = [UIColor clearColor].CGColor;
    subLayer.contents = (id) [UIImage imageNamed:@"1.png"].CGImage;
    [imageLayer addSublayer:subLayer];

1 个答案:

答案 0 :(得分:1)

看到这个样本,它会对你有所帮助 https://github.com/RSully/RSColorPicker/