> At first, I thought I'd be able to set a JS variable from the value of a
> slice within the color palette, like so:
>
> > var myPluginColor1 = [[ColorPalette::PrimaryDark]];
>
> ... but all that does is set my variable equal to the literal string
> '[[ColorPalette::PrimaryDark]]'. I tried adding quotes around the brackets,
> hoping it would parse the value of that tiddler slice, but that didn't work.
>
> Is there a way to get the hex value from the Color Palette and associate it
> with a variable?
var myPluginColor1 =
store.getTiddlerText("ColorPalette::PrimaryDark",defaultValue);
> And on a related note:
>
> *Can you create shadow color palettes in a plugin, similar to the way you
> can create shadow stylesheets?*
>
> As far as I can tell, you can't pull in additional palettes by referencing
> them within the [[ColorPalette]] tiddler inside double brackets (i.e.,
> [[MyExtraColorPalette]]) as you can additional style sheets.
The default ColorPalette simply defines standard core TW slices. When
used within CSS-bearing stylesheets, the TWCore automatically replaces
the slice references before passing the result to the browser for
handling. Note that the CSS can contain references to slices stored
in ANY tiddler, not just ColorPalette. Thus, a plugin can create its
own 'extra' color palette, and then reference those colors from a
custom stylesheet (e.g, by using [[MyColorPalette::slicename]]), or
directly by using store.getTiddlerText(...) within the plugin code.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
----------
Was this answer useful? If so, please help support TiddlyTools:
TiddlyTools direct contributions: (paypal)
http://www.TiddlyTools.com/#Donate
UnaMesa tax-deductible contributions:
http://about.unamesa.org/Participate (paypal)
TiddlyWiki consulting:
http://www.TiddlyTools.com/#ELSDesignStudios
http://www.TiddlyTools.com/#Contact