Color Mode Fill (Seg Line or Seg) - AlbertGBarber/PixelSpork GitHub Wiki

See the Documentation Guide for help understanding each page section.

Effect Sample (see here for sample info)
Mode 1
Mode 1
Mode 2
Mode 2
Mode 3
Mode 3
Mode 4
Mode 4

Description:

Not a full effect, but could be used as one. Fills in the Segment Set using the specified colorMode (see colorModes ) at the specified rate. Useful for drawing simple rainbow shifting effects on a Segment Set using color modes or filling in a background before drawing an effect. For shifting rainbows, remember to set your Segment Set runOffset to true!

For a moving rainbow try out these segment settings with colorMode = 1 for the effect:

//(place these in the Arduino Setup() function)
mainSegments.runOffset = true; //Tells Pixel Spork to move the segment set's rainbow 
mainSegments.gradLenVal = 30; //Sets the length of the rainbow for color mode 3
mainSegments.offsetRateOrig = 80; //Sets the speed of the rainbow movement
mainSegments.offsetDirect = true; //Sets the direction of the rainbow's motion 
                                  //(start of the segment set to the end)

Note that when working with shifting rainbows, you should set the segment set's offsetRate and the effect's update rate to be the same, so that the rainbow moves when the effect updates.

You can do this manually, or by tying their rate pointers together: yourColorModeFill.rate = yourSegmentSet.offsetRate;. (Changing the segment set's offsetRateOrig will now set both the effect and segment set's rates, see common vars rate entry for more info. )

Example Calls:

mainSegments.runOffset = true; //Set the Segment Set to shift its color mode offset over time

//Tie the rates together (see notes in intro)
//Place in the Arduino Setup function
colorModeFill.rate = mainSegments.offsetRate;

ColorModeFillPS colorModeFill(mainSegments, 1, 80);
//Will fill the segment using color mode 1 every 80ms

Constructor Definitions:

ColorModeFillPS(SegmentSetPS &SegSet, uint8_t ColorMode, uint16_t Rate);  

Constructor Inputs:

  • SegmentSetPS* segSet -- The Segment Set the effect will draw on. See common vars segSet entry for more details.

  • uint8_t colorMode -- The colorMode use for the effect.

  • uint16_t* rate -- Update rate (ms). Is a pointer, allowing you to bind it to an external variable. By default it's bound the effect's local variable, rateOrig. See common vars rate entry for more.

Other Settings:

  • CRGB color (default to 0) -- If you want just a static color, you could use this along with colorMode = 0, but effects should already give you this option by themselves.

  • bool showNow (default true) -- Controls if the effect "draws" during each update cycle by calling FastLED.show(). Common to all effects. See common vars showNow entry for more details.

Class Functions:

  • void update();
    Updates the effect.
⚠️ **GitHub.com Fallback** ⚠️