Re: [tw] Background color from color palette

2018-01-14 Thread stevesuny
Jeremy et al thanks! This almost worked as proposed, but I figured it out. 
I was having trouble getting the "#" into the field value.

Here is the working macro, currently implemented at DesignWriteStudio 

 (this 
is for a class I am teaching this semester at SUNY Polytechnic Institute). 
I had to do some odd dancing around in the defines to get the "#" to show 
up in the background-color field.

Questions now: 

<1> on phone, the "prev" and "next" buttons are not properly displaying; 
too far over to the left
<2> I'd like to set the slidenum field to be the same name as the 
"slidetag"  -- so that a given tiddler can be used/ordered in multiple 
slideshows. That would require a transclusion of some sort that I haven't 
begun to figure out. 
<3> I'd hope to be able to color the slide in the same  as displaying 
the slides, but that may not be possible? As you can see, I run through the 
slides on a  twice: once to set the bg color, once to open into the 
story river.

And I hope to bundle this as a plugin (soon).

Thannks!

//steve.

(macro code follows)








\define bgcolor() {{$:/palettes/DWS##$(slidenum)$}}
\define bgcolor2() #$(rgb)$
\define punchshow(slidetag)




<$set name=slidetag value="$slidetag$">



<$button set="$:/state/sidebar" setTo="no" 
tooltip={{$:/language/Buttons/HideSideBar/Hint}} 
aria-label={{$:/language/Buttons/HideSideBar/Caption}} >
<$action-sendmessage $message="tm-close-all-tiddlers"/>
<$action-setfield $tiddler="$:/theme" text="$:/themes/tiddlywiki/punch"/>
<$action-setfield $tiddler="$:/core/ui/ViewTemplate/next" 
tags="$:/tags/ViewTemplate"/>
<$action-setfield $tiddler="$:/core/ui/ViewTemplate/prev" 
tags="$:/tags/ViewTemplate"/>
<$action-setfield $tiddler="$:/core/ui/ViewTemplate/endslideshow" 
tags="$:/tags/ViewTemplate"/>


<$action-setfield $tiddler="$:/fromTiddler" text=<>/>


<$list filter="[tag!nsort[slidenum]]">
<$vars slidenum={{!!slidenum}}>
<$wikify name="rgb" text=<>>
<$action-setfield background-color=<>/>





<$list filter="[tag!nsort[slidenum]]">
<$action-navigate $to=<> />

View slideshow <>

\end

\define endslideshow()
<$button set="$:/state/sidebar" setTo="no">
<$action-setfield $tiddler="$:/theme" text="$:/themes/tiddlywiki/heavier"/>
<$action-listops $tiddler="$:/core/ui/ViewTemplate/next" $field="tags" 
$filter="[[]]"/>
<$action-listops $tiddler="$:/core/ui/ViewTemplate/prev" $field="tags" 
$filter="[[]]"/>
<$action-listops $tiddler="$:/core/ui/ViewTemplate/endslideshow" 
$field="tags" $filter="[[]]"/>
<$action-sendmessage $message="tm-close-all-tiddlers"/>
<$action-navigate $to={{$:/fromTiddler}}/>
End Slideshow

\end

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/84ca5ae2-1b65-45ca-aec5-48b501f68ef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Background color from color palette

2018-01-13 Thread Jeremy Ruston
Hi Steve

Untested, but try this:


<$list filter="[tag!sort]">
<$vars slidenum={{!!slidenum}}>
<$wikify name="rgb" text=<>>
<$action-setfield background-color=<>/>




Given that you’ve got a transclusion in the variable ‘bgcolor’, the wikify 
widget is simply rendering that transclusion, ie converting it into the 
underlying value.

Best wishes

Jeremy.




> On 12 Jan 2018, at 17:48, stevesuny  wrote:
> 
> Hi Folks,
> 
> I'm creating a simple slideshow macro, and trying to set the background color 
> of tiddlers dynamically from the color palette.
> 
> I've added this to ViewTemplate (actually, I copied the 
> $:/core/ui/ViewTemplate from https://tiddlywiki.com/talkytalky/ 
> ) which allows me to set background color 
> according to the background-color field.
> 
> 
> \define frame-styles()
> background-color: $(backgroundColour)$;
> border-color: $(backgroundColour)$;
> \end
> 
> 
> In my current color palette tiddler ($:/palettes/DWS)  I've added these lines:
> 
> 1: #DEFF65
> 2: #FF9563
> 3: #FF7575
> 4: #5AD3FF
> 5: #A7FF7B
> 
> In each of my tiddlers to be colored, I have a field slidenum set to 1..5.
> 
> In my macro I've got this define: 
> 
> \define bgcolor() {{$:/palettes/DWS##$(slidenum)$}}
> 
> And I am using these commands to try to set the background color for each 
> tiddler:
> 
> 
> <$list filter="[tag!sort]">
> <$vars slidenum={{!!slidenum}}>
> <$action-setfield background-color=<>/>
> 
> 
> 
> It almost works, but in my background-color field, instead of the value from 
> the palettte tiddler, I get:
> 
> {{$:/palettes/DWS##1}}
> 
> Some sort of escaping, I'm sure. Any help much appreciated!
> 
> //steve.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to tiddlywiki+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywiki@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywiki 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/850c9dbb-8920-4121-a459-2702380b7fa7%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/B26BEFE2-A764-4C1D-9B74-46057FFEC124%40gmail.com.
For more options, visit https://groups.google.com/d/optout.