This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
A Tinderbox Reference File : Actions & Rules : Color operators |
Color operators |
New v4.0.0 operators let rules and actions manipulate color attribute values. It can often convenient to tie the color of a note to its properties -- for example, to make overdue tasks bright red. For example, you can now make overdue notes red, with a brightness proportional to how overdue they are.
rgb(red,green,blue)
creates a color:Its arguments are integers ranging from 0 to 255 or an expression or attribute reference resolving to a number in this range.
brightness(color,value)
returns a modified color that has the same hue and saturation as the original color, but that has an altered brightness. The color argument is a color type attribute or an expression resolving as the same. The range of value is 0 to 100 or an expression or attribute reference resolving to a number in this range. 0 is dark/black and 100 is light/white.
brightness(color)
returns the brightness of a color, as a numeric value from 0 to 100. The color argument is a color type attribute or an expression resolving as the same.
saturation(color,saturation)
returns a modified color that has the same hue and brightness as the original color, but has an altered saturation. The color argument is a color type attribute or an expression resolving as the same. The range of value is 0 to 100 or an expression or attribute reference resolving to a number in this range. 0 is grey and 100 is fully saturated.
saturation(color)
returns the saturation of a color, as a numeric value from 0 to 100. The color argument is a color type attribute or an expression or attribute reference resolving to a number in this range.
hue(color,value)
returns a modified color that has the same brightness and saturation as the original color, but has an altered hue. The color argument is a color type attribute or an expression resolving as the same. The range of value is 0 to 360 or an expression or attribute reference resolving to a number in this range. In hue terms 0 = 360, the values being degrees of the colour wheel. The primary hue values are 0 = red, 120 = green, 240 = blue (360 = red again!).
hue(color)
returns the hue of a color, as a numeric value from 0 to 360. The color argument is a color type attribute or an expression or attribute reference resolving to a number in this range.
For example
RGB($MyRed,255,255)
Color = brightness(hue(RGB(255,0,0),120),75)
In v4.2.5 changes ensure hue() and saturation() now work properly.
Up: Actions & Rules | |
Previous: Mathematical operators | Next: Date operators |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]