Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. TEMPLATES SYNTAX SUMMARY:
- 2. A compiled list of (mostly) all the style and transition templates in one place for easy reference.
- 3.
- 4. As of ProffieOS 2.8:
- 5.
- 6. Bump<BUMP_POSITION, BUMP_WIDTH_FRACTION>
- 7. // Returns different values for each LED, forming a bump shape.
- 8. // If BUMP_POSITION is 0, bump will be at the hilt.
- 9. // If BUMP_POSITION is 32768, the bump will be at the tip.
- 10. // If BUMP_WIDTH_FRACTION is 1, bump will be extremely narrow.
- 11. // If BUMP_WIDTH_FRACTION is 32768, it will fill up most/all of the blade.
- 12. // BUMP_POSITION, BUMP_WIDTH_FRACTION: INTEGER
- 13. ChangeSlowly<F, SPEED>
- 14. // Changes F by no more than SPEED values per second.
- 15. // F, SPEED: INTEGER
- 16. // return value: INTEGER, same for all LEDs
- 17. Ifon<A, B>
- 18. // Returns A if saber is on, B otherwise.
- 19. // A, B: INTEGER
- 20. // return value: INTEGER
- 21. InOutFunc<OUT_MILLIS, IN_MILLIS>
- 22. // IN_MILLIS, OUT_MILLIS: a number
- 23. // RETURN VALUE: FUNCTION
- 24. // 0 when off, 32768 when on, takes OUT_MILLIS to go from 0 to 32768
- 25. // takes IN_MILLIS to go from 32768 to 0.
- 26. Int<N>
- 27. // Returns N
- 28. // N: a number
- 29. // return value: INTEGER
- 30. Scale<F, A, B>
- 31. // Changes values in range 0 - 32768 to A-B
- 32. // F, A, B: INTEGER
- 33. // return value: INTEGER
- 34. Sin<RPM, LOW, HIGH>
- 35. // pulses between LOW - HIGH RPM times per minute
- 36. // LOW: INTEGER (defaults to Int<0>)
- 37. // HIGH: INTEGER (defaults to Int<32768>)
- 38. // RPM: INTEGER
- 39. // return value: INTEGER
- 40.
- 41.
- 42. Trigger<EFFECT, FADE_IN_MILLIS, SUSTAIN_MILLIS, FADE_OUT_MILLIS>
- 43. // Normally returns 0, but when EFFECT occurs, it ramps up to 32768,
- 44. // stays there for SUSTAIN_MILLIS, then fades down to zero again.
- 45. // EFFECT: BladeEffectType
- 46. // FADE_IN_MILLIS: INTEGER
- 47. // SUSTAIN_MILLIS: INTEGER
- 48. // FADE_OUT_MILLIS: INTEGER
- 49. // return value: INTEGER
- 50.
- 51. —STYLES—
- 52.
- 53. AudioFlicker<colorA, colorB>
- 54. // blade modulated by current sound
- 55. Blast<BASE, BLAST_COLOR, FADEOUT_MS(150), WAVE_SIZE(100), WAVE_MS(400)>
- 56. // blast with wave effect
- 57. BlastFadeout<BASE, BLAST_COLOR, FADEOUT_MS>
- 58. // blast without wave effect, just like a full blade clash
- 59. Blinking<colorA, colorB, BLINK_MILLIS, BLINK_PROMILLE(500)>
- 60. or: BlinkingX<colorA,colorB, BLINK_MILLIS_FUNC, BLINK_PROMILLE_FUNC>
- 61. BrownNoiseFlicker<colorA, colorB, GRADE>
- 62. // Usage: BrownNoiseFlicker<A, B
- 63. // A, B: COLOR
- 64. // return value: COLOR
- 65. // Randomly selects between A and B, but keeps nearby
- 66. // pixels looking similar.
- 67. ByteOrderStyle<BYTEORDER, COLOR>
- 68. // BYTEORDER: Color8::RGB, or one of the other byte orders
- 69. // COLOR: COLOR
- 70. // return value: COLOR
- 71. // This shuffles the RGB values around. It's meant to be used
- 72. // when you are mixing different kind of pixels on one string.
- 73. // While it's not recommended to do so, this should make it
- 74. // easier to compensate by re-ordering the channels.SimpleClash<BASE, CLASH_COLOR, CLASH_MILLIS>
- 75. &style_charging
- 76. // return value: POINTER
- 77. // Charging blade style.
- 78. // Slowly pulsating battery indicator.
- 79.
- 80. ColorCycle<COLOR, PERCENT, RPM>
- 81. or: ColorCycle<COLOR, PERCENT, RPM, ON_COLOR, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS>
- 82. // or: ColorCycle<COLOR, PERCENT, RPM, ON_COLOR, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS>
- 83. // COLOR, ON_COLOR: COLOR
- 84. // RPM, PERCENT, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS: a number
- 85. // return value: COLOR
- 86. // This is intended for a small ring of neopixels
- 87. // A section of the ring is lit at the specified color
- 88. // and rotates at the specified speed. The size of the
- 89. // lit up section is defined by "percentage".
- 90. ColorSequence<MILLIS_PER_COLOR, COLOR1, COLOR2, ….>
- 91.
- 92. Cylon<COLOR, PERCENT, RPM>
- 93. or: ColorCycle<COLOR, PERCENT, RPM, ON_COLOR, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS>
- 94. // COLOR, ON_COLOR: COLOR
- 95. // RPM, PERCENT, ON_PERCENT, ON_RPM, FADE_TIME_MILLIS: a number
- 96. // return value: COLOR
- 97. // Cylon/Knight Rider effect, a section of the strip is
- 98. // lit up and moves back and forth. Speed, color and fraction
- 99. // illuminated can be configured separately for on and off
- 100. // states.
- 101. Gradient<colorA, colorB>
- 102. or: Gradient<colorA, colorB, colorC, …>
- 103. HumpFlicker<colorA, colorB, HUMP_WIDTH>
- 104. IgnitionDelay<DELAY_MILLIS, BASE>
- 105. InOutHelperX<BASE, EXTENSION, RETRACTION,OFF_COLOR>
- 106. InOutSparkTip<BASE, OUT_MILLIS, IN_MILLIS, SPARK_COLOR>
- 107. LocalizedClash<Base, Clash_color, LENGTH_MILLIS, BLADE_PERCENTAGE>
- 108. Lockup<BASE, LOCKUP_COLOR, DRAG_COLOR>
- 109. Mix<colorA, colorB, F>
- 110. // mix between A and B using function F.
- 111. // F = 0 -> return A, F = 16384 -> return (A+B)/2, F = 32768 -> return B
- 112. OnSpark<BASE, SPARK_COLOR, MILLIS>
- 113. OriginalBlast<BASE, BLAST_COLOR>
- 114. // Blast with wave, but wave has BrownNoiseFlicker
- 115. Pulsing<colorA, colorB, PULSE_MILLIS>
- 116. or: Pulsing<colorA, colorB, PULSE_MILLIS_FUNC>
- 117. RandomBlink<MILLIHZ, COLOR1, COLOR2>
- 118. or: RandomBlinkX<MILLIHZ_CLASS, COLOR1, COLOR2>
- 119. RandomFlicker<colorA, colorB>
- 120. RandomPerLEDFlicker<colorA, colorB>
- 121. RgbCycle (no arguments)
- 122. // return value: COLOR
- 123. // Very fast Red, Green, Blue cycle, result should essentially be white
- 124. // until you start swinging it around.
- 125. Rgb<R, G, B>
- 126. return value: COLOR
- 127. Sequence<COLOR1, COLOR2, int millis_per_bits, int bits, 0b0000000000000000, ....>
- 128. SimpleClash<BASE, CLASH_COLOR, CLASH_MILLIS>
- 129. // BASE: COLOR
- 130. // CLASH_COLOR: COLOR (defaults to white)
- 131. // CLASH_MILLIS: a number (defaults to 40)
- 132. // return value: COLOR
- 133. // Turns the blade to CLASH_COLOR for CLASH_MILLIS millseconds
- 134. // when a clash occurs.
- 135. Sparkle<BASE, SPARKLE_COLOR, SPARK_CHANCE_PROMILLE, SPARK_INTENSITY>
- 136. Stripes<WIDTH, SPEED, COLOR1, COLOR2, ... >
- 137. Strobe<BASE, STROBE_COLOR, STROBE_FREQUENCY, STROBE_MILLIS>
- 138. or: StrobeX<BASE, STROBE_COLOR, STROBE_FREQUENCY_FUNC, STROBE_MILLIS_FUNC>
- 139. StylePtr<BLADE>
- 140. // blade style gets wrapped in this class
- 141.
- 142.
- 143. As of ProffieOS 3.6 BETA:
- 144.
- 145. —STYLES—
- 146.
- 147. RetractionDelay<DELAY_MILLIS, BASE>
- 148. ColorChange<TRANSITION, COLORS>
- 149. RotateColorsX<ROTATION, COLOR>
- 150. // ROTATION specifies how much to rotate the color in HSV (color wheel) space.
- 151. // 0 = none, 32768 = 360degrees
- 152. TransitionEffect<COLOR, EFFECT_COLOR, TRANSITION1, TRANSITION2, EFFECT>
- 153. // COLOR, EFFECT_COLOR: COLOR
- 154. // TRANSITION1, TRANSITION2 : TRANSITION
- 155. // EFFECT: effect type
- 156. // return value: COLOR
- 157. // When the specified EFFECT happens (clash/blast/etc.) transition from COLOR to
- 158. // EFFECT_COLOR using TRANSITION1. Then transition back using TRANSITION2.
- 159.
- 160. TransitionLoop<COLOR, TRANSITION>
- 161. // Continuously transitions COLOR to COLOR
- 162. // Makes more sense if TRANSITION is a TrConcat, as this will
- 163. // transition to/from the intermediate steps in a loop.
- 164.
- 165. —TRANSITIONS— (Insert these where it says TRANSITION in a template) (Not sure about how to integrate Functions)
- 166.
- 167. InOutTr<BASE, OUT_TRANSITION, IN_TRANSITION, OFF_COLOR>
- 168. // Similar to InOutHelper<>, but uses configurable transitions
- 169. // to go to and from the BASE to the OFF_COLOR.
- 170. TrFadeX<MILLIS_FUNCTION, N>
- 171. or: TrFade<MILLIS, N>
- 172. // MILLIS_FUNCTION: FUNCTION
- 173. // MILLIS: a number
- 174. // N: a number
- 175. // Transitions back and forth between the two colors several times. (As specified by N).
- 176. // If N is 0, it's equal to TrFade. If N is 1 it transitions A-B-A-B, if N is 2, it is A-B-A-B-A-B, and so on.
- 177. TrColorCycle<MILLIS, START_RPM, END_RPM>
- 178. // MILLS: number
- 179. // START_RPM: a number (defaults to 0)
- 180. // END_RPM: a number (defaults to 6000)
- 181. // return value: COLOR
- 182. // Tron-like transition.
- 183. TrConcat<TRANSITION, INTERMEDIATE, TRANSITION, ...>
- 184. // TRANSITION: TRANSITION
- 185. // INTERMEDIATE: COLOR
- 186. // Concatenates (combines) any number of transitions. In between each transition,
- 187. //we need an intermediate color to transition to.
- 188. TrDelayX<MILLIS_FUNCTION>
- 189. or: TrDelay<MILLIS>
- 190. // MILLIS_FUNCTION: FUNCTION
- 191. // MILLIS: a number
- 192. // Waits for the specified number of milliseconds, then transitions
- 193. // to second color. Meant to be used with TrConcat
- 194. TrFadeX<MILLIS_FUNCTION>
- 195. or: TrFade<MILLIS>
- 196. // MILLIS_FUNCTION: FUNCTION
- 197. // MILLIS: a number
- 198. // Linear fading between two colors in specified number of milliseconds.
- 199. TrInstant
- 200. // Instant Transition
- 201. TrJoin<TR1, TR2, ...>
- 202. // TR1, TR2: TRANSITION
- 203. // A little hard to explain, but all the specified transitions are run in parallel.
- 204. //Basically, we chain transitions like ((A TR1 B) TR2 B)
- 205. TrJoinR<TR1, TR2, ...>
- 206. // Similar to TrJoin, but transitions are chained to the right instead of to the left.
- 207. // Like: (A TR2 (A TR1 B))
- 208. TrRandom<TR1, TR2, ...>
- 209. // TR1, TR2: TRANSITION
- 210. // Each time a new transition is started, a random transition is picked from
- 211. // the specified list of transitions.
- 212. TrSmoothFadeX<MILLIS_FUNCTION>
- 213.
- ⁃ // or: TrSmoothFade<MILLIS>
- ⁃ // MILLIS_FUNCTION: FUNCTION
- ⁃ // MILLIS: a number
- ⁃ // return value: TRANSITION
- ⁃ // Similar to TrFade, but uses a cubic fading function
- 214. // so fading starts slow, speeds up in the middle, then
- 215. // slows down at the end.
- 216.
- 217. TrWipeX<MILLIS_FUNCTION>
- 218. or: TrWipe<MILLIS>
- 219. // MILLIS_FUNCTION: FUNCTION
- 220. // MILLIS: a number
- 221. // Similar to saber ignition. In the beginning entire blade is color A,
- 222. // then color B starts at the base and extends up to the tip of the blade
- 223. // in the specified number of milliseconds.
- 224. TrWipeInX<MILLIS_FUNCTION>
- 225. or: TrWipeIn<MILLIS>
- 226. // Like TrWipe, but from tip to base.
- 227.
- 233.
- 234.
- 235. —FUNCTIONS—
- 236.
- 237. SmoothStep<POS, WIDTH>
- 238. // POS, WIDTH: FUNCTION
- 239. // POS: specifies the middle of the smoothstep, 0 = base of blade, 32768=tip
- 240. // WIDTH: witdth of transition, 0 = no transition, 32768 = length of blade
- 241. // Example: SmoothStep<Int<16384>, Int<16384>> returns 0 up until 25% of the blade.
- 242. // From there it has a smooth transition to 32768, which will be reached at 75% of the blade.
- 243. // If WIDTH is negative, the transition will go the other way.
- 244. SmoothSoundLevel
- 245. // Returns 0-32768 based on sound level.
- 246. // returned value: INTEGER
- 247. NoisySoundLevel
- 248. // Returns 0-32768 based on sound level.
- 249. // returned value: INTEGER
- 250. SwingSpeed<MAX>
- 251. // Returns 0-32768 based on swing speed
- 252. // returned value: INTEGER
- 253.
- 254.
- 255.
- 256. ## Additional new Styles in sa22c CC fork release:
- 257.
- 258. - Flare<Base_color, Flare_color, Flare Width>
- 259. - Stab<Base_color, Stab_Color(White), Stab_millis(500), Stab_width(50)>
- 260.
- 261. - LocalizedLockup<Base, Lockup_color, Drag_color, Block_color, Lockup Walk (200ms), Lockup Width (50% of blade), Block Walk (50ms), Block Width (20size), Drag Width (30%)> Localized Lockup and Force Lightning Lockup (Block) animation effects based on Fett263’s Dual Lockup mod in a single compact style to create a super easy implantation, greatly reducing style sizes – I really want to call attention to the work Matt did on this, this was a very complex and painstaking amount of work to create this excellent update to the effects.
- 262.
- 263. - ColorChange<COLORS...> =
- 264. List as many colors (or effects) within the style and advance through list using "on-the-fly" change.
- 265. Example = ColorChange<Red,Orange,Yellow,Green,DeepSkyBlue,Blue,Pink,Magenta>
- 266.
- 267. - ColorChangeFade<TRANSITION (ms), COLORS...> =
- 268. List as many colors (or effects) within the style and advance through list using "on-the-fly" change. Each color will fade into the next over the TRANSITION TIME (ms).
- 269. Example = ColorChangeFade<400,Red,Orange,Yellow,Green,DeepSkyBlue,Blue,Pink,Magenta> (fade will take 400ms per color)
- 270.
- 271. - EffectScroll<DISPLAY (ms), COLORS...> =
- 272. List as many colors (or effects) within the style and advance through list using "scroll/select". To change colors/effects activate "Scroll Mode" and continously advance through the list with each item showing for DISPLAY (ms) until you "Select". Shorter display times will act as a quick menu, longer display times will allow the Scroll Mode to act like a DEMO Mode, which can be entered or exited at will.
- 273.
- 274. - ColorScroll<DISPLAY (ms), COLORS...> =
- 275. List as many colors (or effects) within the style and advance through list using "on-the-fly" change OR "scroll/select". Each "on-the-fly" change will advance through the list one at a time OR activate "Scroll Mode" and continuously advance through the list with each item showing for DISPLAY (ms) until you "Select". Shorter display times will act as a quick menu, longer display times will allow the Scroll Mode to act like a DEMO Mode, which can be entered or exited at will.
- 276.
- 277. - ChangeSpark<Base, Spark_color, Transition (ms)>
- 278. ChangeSpark allows a Color or Effect to be implemented with “on-the-fly” color change effects. The Spark color/effect will display and fade over the Transition Time every time the Color Change Effect is activated to add additional “accents” to your color change styles.
- 279.
- 280. - EndSpark<Base, Spark_color, Transition (ms)>
- 281. EndSpark allows a Color or Effect to be implemented anytime a Lockup is ended, the color/effect will display and fade over the Transition Time to mimic the blade normalizing or cooling off.
- 282.
- 283. - OffSpark<Base, Spark_color, Transition (ms)>
- 284. OffSpark allows a Color or Effect to be implemented during blade retraction, the color/effect will display and fade over the Transition Time to mimic the blade normalizing or cooling off, when used with an InOutHelper you will want to allow adequate retraction time for the effect to display.
- 285.
- 286. -
- 287.
- 288. ——————
- 289.
- 290. undocumented yet:
- 291.
- 292. StyleFire
- 293. many more….
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement