Sorry a little late, but my brain was out of commission for the weekend so I only finished my solution now, but good to see that Charlie could help you already.
Still if you are interested: I used two macros working with the given titles/tags to make it more modular so it can be extended in the future. The only thing I have yet to work out is different combinations for the same colour.
The first and simpler macro is used to get the colours needed to mix the colour:
\define get-combination()
<$list filter="[!has[draft.of]tag<currentTiddler>sort[title]first[]]">
<$link to=<<currentTiddler>> />
</$list>
<$list filter="[!has[draft.of]tag<currentTiddler>sort[title]butfirst[]]">
+ <$link to=<<currentTiddler>> />
</$list>
\end
The only difference between the filters is that the first only uses the first result and the second uses the rest to get the formatting of 'colour + colour' with as many '+ colour' as needed for the current combination.
So the filter in detail:
- !has[draft.of] just makes sure that only tiddlers not currently edited are used.
- tag<currentTiddler> looks for tiddlers that are tagged with the title of the tiddler the macro is called in. For instance if you call the macro in a tiddler called 'Orange' it will look if there are tiddlers tagged 'Orange'.
- sort[title] sorts the resulting list by the tiddlers titles.
- first[] then discards everything except for the first title in the list and butfirst[] does the opposite and takes the rest.
The second macro that is used to get all combinations with a specific colour:
\define get-color-combinations()
<$list filter="[<currentTiddler>tags[]]" variable="tag">
<$list filter="[<tag>tag[Mixed Color]]" variable="mixed-color">
<<currentTiddler>>
<$list filter="[!has[draft.of]tag<mixed-color>!<currentTiddler>]" variable="other-color">
+ <$link to=<<other-color>> />
</$list>
= <$link to=<<mixed-color>> />
<br />
</$list>
</$list>
\end
And the details:
- The first list just gets all the tiddlers of the currentTiddler and puts it in a variable called tag as to not overwrite currentTiddler.
- The second list filters for mixed colors related to the currentTiddler.
- <tag> is just a shortform of title<tag> and looks for a tiddler that is named the same as the value of the tag variable.
- tag[Mixed Color] then looks if the tiddler it found has the tag 'Mixed Color'.
- the result gets put into a variable called mixed-color once again so currentTiddler isn't overwritten.
- Then the title of the current tiddler is 'printed' as the first part of
the final text. This is not a link as this is the currently used
tiddler.
- The third list then looks for the other colour/colours that are tagged with the current mixed-color.
- !has[draft.of] once again making sure only tiddlers not being edited get used.
- tag<mixed-color> looks for tiddlers tagged with the value of mixed-color.
- !<currentTiddler> but only take those that aren't the current-tiddler.
- and another variable this time called other-color.
- Now print each found colour with '+ other-color' to create the second part of the result. These are all links to their respective tiddlers.
- And finally when the previous list is finished with adding colours add '= mixed-color' plus a line-break as the third and last part of the result. Once again this is a link to the tiddler.
The first macro can be used both in tiddler with a mixed colour and in a general combination overview like so:
<$list filter="[!has[draft.of]tag[Mixed Color]sort[title]]" >
<$link to=<<currentTiddler>> />:
<<get-combination>>
<br />
</$list>
The second macro can be used in any colour tiddler that is part of a mixed colour both basic colour and mixed colour.
And because this reply is not long enough already here a few screenshots:
Tiddler 'Red' with <<get-color-combinations>> in use also showing a combination from three colours:
Tiddler 'Green' showing the colours needed to mix it via <<get-combination>>:
The overview tiddler of possible combinations:
And a version of the Violet Tiddler that uses both macors:
I attached a json file for easy import should you want to use it/play around with it.
Also I second Charlie in that I would love to see whatever the end result might be.