是否可以自定义CAEmitterCell发出的粒子的颜色?

时间:2015-12-09 03:39:59

标签: objective-c core-animation caemittercell

我使用CAEmitterCell生成各种不同颜色的给定图像的粒子:

CAEmitterCell *emitterCell = [CAEmitterCell emitterCell];
emitterCell.birthRate = 256;
emitterCell.lifetime = 3.0f;
emitterCell.lifetimeRange = 2.0f;
emitterCell.emissionRange = 2 * M_PI;
emitterCell.velocity = 1024;
emitterCell.contents = (__bridge id)myImage;
emitterCell.color = [NSColor whiteColor].CGColor;
emitterCell.redRange = 1.0;
emitterCell.greenRange = 1.0;
emitterCell.blueRange = 1.0;
emitterCell.alphaSpeed = -0.5;

这导致由各种颜色制成的颗粒。我想将此限制为仅改变颜色的色调,同时保持饱和度和亮度相同(分别为100%和50%),以创造更令人愉悦的彩虹色彩。

是否可以使用CAEmitterCell

执行此操作

0 个答案:

没有答案