Is it possible to use a colour variable with functions

I’m trying to cut down on available space and one way would be if I could use a function from Fett’s config helper for the crystal chamber. My crystal is its own blade and the only thing different across styles is the colour.

For example: (code made up to try and explain what i’m looking for)

using crystal = Layers<
  Pulsing<Mix<Int<8192>,RgbArg<BASE_COLOR_ARG,Black>,RgbArg<BASE_COLOR_ARG,FunctionArg>>,RgbArg<BASE_COLOR_ARG,FunctionArg>,8000>,
  InOutTrL<TrInstant,TrInstant,Pulsing<Mix<Int<8192>,Black,RgbArg<OFF_COLOR_ARG,FunctionArg>>,RgbArg<OFF_COLOR_ARG,FunctionArg>,2000>>>>()



StylePtr<crystal<FunctionArg<red>>>()


etc..

Yes, in OS7 you can set any of the style arguments for a style or using in your config. But you need to use Rgb16 values for each color you want to edit in the correct order and “~” for a value that is missing or should use the default.

The correct syntax would be (based on your using function):

StylePtr<crystal>("65535,0,0 ~ ~ ~ "),

See discussion here:

Style argument info here:

This will be coming to the Config Helper tool as well, more explanation and demo here:

Awesome, appreciate the help. Got it working

I did notice in your os7 builder when generating the config it removes the quotes from ("65535,0,0 ~ ~ ~ "),

I am still debugging the config tool that was just a demo video of what’s to come :wink:

Ah I hate to bring this up again, I thought it was working but its not with functions. For the actual function does it matter what color is set to begin with. For example if I have the function as blue default but I want a preset red I have:

using crystal = 
Layers<
  RandomPerLEDFlicker<RgbArg<BASE_COLOR_ARG,DeepSkyBlue>,RgbArg<ALT_COLOR_ARG,Blue>>,
InOutTrL<TrInstant,TrInstant,Pulsing<Mix<Int<8192>,Black,RgbArg<OFF_COLOR_ARG,Blue>>,RgbArg<OFF_COLOR_ARG,Blue>,2000>>>;

And preset to change to red:

StylePtr<crystal>("65535,0,0 ~ ~ ~ "),

When I change to the preset it remains blue

It works the same for using function, it doesn’tmatter what default is set. Would need your full config.

Edit:
Do you mean the OFF_COLOR_ARG?
That is the 31st argument so you need to set it accordingly as the 31st argument in the string.

("65535,0,0 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 65535,0,0")

yeah you are right, works now