Discussion:
[tw5] Color Button from Color Palette in TW5?
Tiddly Novice
2018-12-07 23:24:40 UTC
Permalink
Hello,
I'm new to TiddlyWiki and I need some help. A lot of help, in fact. But for
clarity, I'll try to keep it to one problem per post unless told to do
otherwise.

Problem #1:

Background: I'm trying to create a button that can be used to assign a
color to a known field of a tiddler. The button should end up being colored
like the last button visible in the color palette macro once the color has
been picked.

Problem: I can't figure out how to get the button used to open the popup to
get changed to the color chosen in the palette.
<$button popup=<<qualify "colorcal_">>>Pop me up!</$button>
<$reveal type="popup" state=<<qualify "colorcal_">>>
<div class="tc-popup-keep">
! This is the popup
Colour: <$edit-text tiddler='$:/_MyColour' tag='input'
placeholder='(unset)' default=''/>
---
<$macrocall $name='colour-picker' actions="
<$action-setfield $field=<<qualify colorfield1_>>
$tiddler=<<currentTiddler>> $value=<<colour-picker-value>>/>
"/>
</div>
</$reveal>
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/b9a0d0a6-bbc9-4d8f-aa9e-537e2b6a5653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tiddly Novice
2018-12-07 23:25:43 UTC
Permalink
I also don't know how best to post my code here. First time I've used
Google Groups to ask about code.
Post by Tiddly Novice
Hello,
I'm new to TiddlyWiki and I need some help. A lot of help, in fact. But
for clarity, I'll try to keep it to one problem per post unless told to do
otherwise.
Background: I'm trying to create a button that can be used to assign a
color to a known field of a tiddler. The button should end up being colored
like the last button visible in the color palette macro once the color has
been picked.
Problem: I can't figure out how to get the button used to open the popup
to get changed to the color chosen in the palette.
<$button popup=<<qualify "colorcal_">>>Pop me up!</$button>
<$reveal type="popup" state=<<qualify "colorcal_">>>
<div class="tc-popup-keep">
! This is the popup
Colour: <$edit-text tiddler='$:/_MyColour' tag='input'
placeholder='(unset)' default=''/>
---
<$macrocall $name='colour-picker' actions="
<$action-setfield $field=<<qualify colorfield1_>>
$tiddler=<<currentTiddler>> $value=<<colour-picker-value>>/>
"/>
</div>
</$reveal>
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/0281d58c-eb29-4df8-bf01-d195613195ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
TonyM
2018-12-08 02:28:28 UTC
Permalink
Tiddly novice,

Welcome to the community. On Posting in the onlin forum, ues the { } button
once selecting some code to add it as code

\define colour-swatch() @@color:{{!!colour}};⚫@@
<<colour-swatch>> Colour: <$edit-text field='colour' tag='input' placeholder
='(unset)' default='' class="tc-edit-texteditor"/>

<details><summary>__Select colour__</summary>

---

<$macrocall $name='colour-picker' actions="


<$action-setfield $tiddler=<<editTiddler>> $field='colour'
$value=<<colour-picker-value>>/>


"/>
</details>

Above is a color selector I used previously, with help from others, or was
that in tiddlywiki itself. colour is a special field in TiddlyWiki, its
existence is displayed as a colour in edit mode. Just add the field to any
tiddler (note English spelling)

Modify as you wish

Regards
Tony
Post by Tiddly Novice
Hello,
I'm new to TiddlyWiki and I need some help. A lot of help, in fact. But
for clarity, I'll try to keep it to one problem per post unless told to do
otherwise.
Background: I'm trying to create a button that can be used to assign a
color to a known field of a tiddler. The button should end up being colored
like the last button visible in the color palette macro once the color has
been picked.
Problem: I can't figure out how to get the button used to open the popup
to get changed to the color chosen in the palette.
<$button popup=<<qualify "colorcal_">>>Pop me up!</$button>
<$reveal type="popup" state=<<qualify "colorcal_">>>
<div class="tc-popup-keep">
! This is the popup
Colour: <$edit-text tiddler='$:/_MyColour' tag='input'
placeholder='(unset)' default=''/>
---
<$macrocall $name='colour-picker' actions="
<$action-setfield $field=<<qualify colorfield1_>>
$tiddler=<<currentTiddler>> $value=<<colour-picker-value>>/>
"/>
</div>
</$reveal>
I also don't know how best to post my code here. First time I've used
Google Groups to ask about code. Sorry if I got it wrong.
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/82513282-aa07-4c13-a849-d4150f5bd42d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...