# Is it possible to use a colour variable with functions

**URL:** <https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261>\
**Category:** ProffieOS\
**Created:** [April 18, 2023, 4:47pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261 "2023-04-18T16:47:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danake](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/d/a587f6/32.png) [@Danake](https://crucible.hubbe.net/u/Danake)\
**Post date:** [April 18, 2023, 4:47pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/1 "2023-04-18T16:47:17Z")

</div>

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)

```auto
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..

```

---

<div class="post-metadata">

**Author:** ![Fett263](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/fett263/32/214_2.png) [@Fett263](https://crucible.hubbe.net/u/Fett263)\
**Post date:** [April 18, 2023, 5:22pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/2 "2023-04-18T17:22:12Z")

</div>

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):

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

```

See discussion here:

> [@ProffieOS6 & 7 Config Helper Tool v.2](https://crucible.hubbe.net/t/proffieos6-7-config-helper-tool-v-2/3020/19):
>
> Here’s an example that seems to work. StylePtr\<CrystalHyperResponsiveRotoscopeOriginalTrilogyDodgerBlue\>( "65535,0,0 ~ ~ ~ ~ ~ 0,65535,0 ~ 0,65535,0 0,65535,0" ), I was hoping to be able to do something like the following to make it more human readable, but from what I can tell, that’s not possible. Will definitely work for making a complex style and reusing it multiple times. StylePtr\<CrystalHyperResponsiveRotoscopeOriginalTrilogyDodgerBlue\>( "65535,0,0 " // BASE\_COLOR\_ARG = 1, // Primary Base Color "~ " //ALT\_COLOR\_ARG = 2, // Alternate or Force Color (free-use) "~ " //STYLE\_OPTION\_ARG = 3, // Style Option "~ " //IGNITION\_OPTION\_ARG = 4, // Ignition Options "~ " //IGNITION\_TIME\_ARG = 5, // used in IgnitionTime alias "~ " //IGNITION\_DELAY\_ARG = 6, // Ignition Delay Time "0,65535,0" //IGNITION\_COLOR\_ARG = 7, // Ignition "Power Up" Color "~ " //IGNITION\_POWER\_UP\_ARG = 8, // Ignition "Power Up" Options "0,65535,0" //BLAST\_COLOR\_ARG = 9, // Blast Color ),

Style argument info here:

> **[Style Arguments](https://pod.hubbe.net/config/styles/style_arguments.html)**
>
> Documentation for ProffieOS

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

[![](https://img.youtube.com/vi/5O5UgEQ-cJM/maxresdefault.jpg "ProffieOS7 Config Tool, Using Functions and Style Arguments Sneak Peek") ](https://www.youtube.com/watch?v=5O5UgEQ-cJM)

---

<div class="post-metadata">

**Author:** ![Danake](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/d/a587f6/32.png) [@Danake](https://crucible.hubbe.net/u/Danake)\
**Post date:** [April 18, 2023, 6:24pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/3 "2023-04-18T18:24:29Z")

</div>

Awesome, appreciate the help. Got it working

---

<div class="post-metadata">

**Author:** ![Danake](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/d/a587f6/32.png) [@Danake](https://crucible.hubbe.net/u/Danake)\
**Post date:** [April 18, 2023, 8:10pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/4 "2023-04-18T20:10:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fett263](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/fett263/32/214_2.png) [@Fett263](https://crucible.hubbe.net/u/Fett263)\
**Post date:** [April 18, 2023, 8:15pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/5 "2023-04-18T20:15:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Danake](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/d/a587f6/32.png) [@Danake](https://crucible.hubbe.net/u/Danake)\
**Post date:** [May 10, 2023, 1:01pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/6 "2023-05-10T13:01:26Z")

</div>

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:

```auto
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:

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

```

When I change to the preset it remains blue

---

<div class="post-metadata">

**Author:** ![Fett263](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/fett263/32/214_2.png) [@Fett263](https://crucible.hubbe.net/u/Fett263)\
**Post date:** [May 10, 2023, 1:20pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/7 "2023-05-10T13:20:16Z")

</div>

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.

> <https://github.com/profezzorn/ProffieOS/blob/c39daac1642affd724891e05e2c596571236d3ac/styles/edit_mode.h#L41>

```auto
("65535,0,0 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 65535,0,0")

```

---

<div class="post-metadata">

**Author:** ![Danake](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/d/a587f6/32.png) [@Danake](https://crucible.hubbe.net/u/Danake)\
**Post date:** [May 10, 2023, 5:19pm UTC](https://crucible.hubbe.net/t/is-it-possible-to-use-a-colour-variable-with-functions/3261/8 "2023-05-10T17:19:13Z")

</div>

yeah you are right, works now
