55 :(
OOColor *)col1 :(
OOColor *)col2 andSystemInfo:(NSDictionary *)systemInfo
56{
58 float clusterChance,
59 alpha,
60 scale,
61 starCountMultiplier,
62 nebulaCountMultiplier;
63 signed starCount,
64 nebulaCount;
65
66 self = [super init];
67 if (
self ==
nil)
return nil;
68
71
72
73 BOOL nebulaColorSet = [self readColor1:&col1 andColor2:&col2 andColor3:&col3 andColor4:&col4 fromDictionary:systemInfo];
74
77 {
79 }
80
81
82 clusterChance = [systemInfo oo_floatForKey:@"sky_blur_cluster_chance" defaultValue:SKY_clusterChance];
83 alpha = [systemInfo oo_floatForKey:@"sky_blur_alpha" defaultValue:SKY_alpha];
84 scale = [systemInfo oo_floatForKey:@"sky_blur_scale" defaultValue:SKY_scale];
85
86
87 starCount = [systemInfo oo_floatForKey:@"sky_n_stars" defaultValue:-1];
88 starCountMultiplier = [systemInfo oo_floatForKey:@"star_count_multiplier" defaultValue:1.0f];
89 if (starCountMultiplier < 0.0f) starCountMultiplier *= -1.0f;
90 if (0 <= starCount)
91 {
92
93
94 starCount *= starCountMultiplier;
95 }
96 else
97 {
99 }
100
101
102 nebulaCount = [systemInfo oo_floatForKey:@"sky_n_blurs" defaultValue:-1];
103 nebulaCountMultiplier = [systemInfo oo_floatForKey:@"nebula_count_multiplier" defaultValue:1.0f];
104 if (nebulaCountMultiplier < 0.0f) nebulaCountMultiplier *= -1.0f;
105 if (0 <= nebulaCount)
106 {
107
108
109 nebulaCount *= nebulaCountMultiplier;
110 }
111 else
112 {
114 }
115
117 {
118
120 {
122 }
123 starCount /= 2;
125 {
127 }
128 }
129
131 initWithColor1:col1
132 Color2:col2
133 Color3:col3
134 Color4:col4
135 starCount:starCount
136 nebulaCount:nebulaCount
137 nebulaHueFix:nebulaColorSet
138 clusterFactor:clusterChance
139 alpha:alpha
140 scale:scale];
141 [self setDrawable:skyDrawable];
142 [skyDrawable release];
143
144 [self setStatus:STATUS_EFFECT];
145
146 return self;
147}
OOColor * blendedColorWithFraction:ofColor:(float fraction,[ofColor] OOColor *color)