xnano.core.effects
xnano.core.effects
¶
xnano.core.effects
Turn effect descriptions into native tachyonfx effects.
Functions:
-
build_native_effect–Lower an effect description to a native effect instance.
-
apply_native_cell_filter–Apply an effect description's terminal cell filter to an effect.
-
resolve_native_effect–Resolve and lower an effect description to a native effect.
build_native_effect
¶
build_native_effect(effect: AbstractEffect) -> Effect
Lower an effect description to a native effect instance.
Parameters:
-
effect(AbstractEffect) –The neutral effect description to lower.
Returns:
-
Effect–A native
Effectready to run.
Source code in xnano/core/effects.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
apply_native_cell_filter
¶
apply_native_cell_filter(
effect_description: AbstractEffect,
native_effect: Effect,
) -> Effect
Apply an effect description's terminal cell filter to an effect.
Source code in xnano/core/effects.py
resolve_native_effect
¶
resolve_native_effect(
effect: AbstractEffect | KnownEffectKind,
*,
duration_ms: int = 300,
color: ColorLike | None = None,
background: ColorLike | None = None,
direction: EffectMotion | None = None,
gradient_length: int | None = None,
randomness: int | None = None,
interpolation: EffectInterpolation | None = None,
effects: Sequence[AbstractEffect] | None = None,
child: AbstractEffect | None = None,
times: int | None = None,
key: str | None = None
) -> Effect
Resolve and lower an effect description to a native effect.
Terminal-only: lowers through build_native_effect. See the
xnano.effects module docstring for why this lowering step lives
behind the terminal controller rather than growing a second (web)
lowering path there.
Parameters:
-
effect(AbstractEffect | KnownEffectKind) –A built effect instance or a known effect kind string.
-
duration_ms(int, default:300) –Duration of the effect in milliseconds.
-
color(ColorLike | None, default:None) –Foreground or accent color for color-driven effects.
-
background(ColorLike | None, default:None) –Background color for two-color effects.
-
direction(EffectMotion | None, default:None) –Motion direction for slide and sweep effects.
-
gradient_length(int | None, default:None) –Gradient length for slide and sweep effects.
-
randomness(int | None, default:None) –Randomness for slide and sweep effects.
-
interpolation(EffectInterpolation | None, default:None) –Interpolation curve for the effect.
-
effects(Sequence[AbstractEffect] | None, default:None) –Child effects for sequence and parallel composition.
-
child(AbstractEffect | None, default:None) –Child effect for repeat and delay composition.
-
times(int | None, default:None) –Repeat count for repeat effects.
-
key(str | None, default:None) –Identity used by a controller to de-duplicate this effect per target field.
Returns:
-
Effect–A native
Effectinstance.