Si,
A quick attempt to edit-text to the field <$edit-text field=color/> shows
it is still using the picker, so it seems it is this widget that is
choosing to use the picker.
- Found edit-text widget defined in $:/core/modules/widgets/edit-text.js
I have not yet uncovered the full story. It is similar to when when you use
{{!!modified}} in a tiddler, the system intervenes and responds with a
formatted date.
Regards
Tones
On Sunday, 25 July 2021 at 23:55:37 UTC+10 Si wrote:
> Wow thanks a lot Eric, yet again you have gone above and beyond.
>
> Is there some part of the TiddlyWiki core that is telling TiddlyWiki to
> use the color-picker for the color field, or is this just something that
> the browser does automatically?
>
> On Sunday, 25 July 2021 at 10:07:14 UTC+1 Eric Shulman wrote:
>
>> Give this a try:
>>
>> Copy the following tiddlers into your own TW document:
>>
>> https://tiddlytools.com/edit-list.html#TiddlyTools%2FMacros%2Fedit-list
>>
>> https://tiddlytools.com/edit-list.html#TiddlyTools%2FSettings%2FColors%2FX11Names
>>
>> https://tiddlytools.com/edit-list.html#TiddlyTools%2FMacros%2Fedit-list%2FColorEditTemplate
>>
>> The ColorEditTemplate uses this macro:
>> <<edit-list field:color colors:yes find:yes focusPopup:yes
>> placeholder:"select a color"
>> filter:[{TiddlyTools/Settings/Colors/X11Names}]>>
>>
>> Notes:
>> * *field:color* targets the "color" field of the tiddler
>> * *colors:yes* shows the list items using their color values as the
>> background of each item
>> * *find:yes* progressively filters the list for partial matches as you
>> type in a color name
>> * *focusPopup:yes* automatically shows the list of colors when the color
>> field gets focus
>> * *filter:[{TiddlyTools/Settings/Colors/X11Names}]* uses a list of
>> standard X11 color names
>>
>> Also note that the ColorEditTemplate *doesn't automatically hide the
>> TWCore default color field* RGB color picker interface.
>> To hide the default RBG color picker, create a tiddler named
>> *$:/config/EditTemplateFields/Visibility/color* with contents of *hide*
>>
>> Let me know how it goes...
>>
>> enjoy,
>> -e
>> On Saturday, July 24, 2021 at 6:29:14 PM UTC-7 TW Tones wrote:
>>
>>> Si,
>>>
>>> I have always felt the color picker falls short, though it seems to be a
>>> HTML default. My research suggests it already users color names in the
>>> pallet.
>>>
>>> - I would like to be able to search for color names in the picker
>>> - or past a color number into the picker I extract from anywhere
>>> with an in browser color picker
>>> - I have a collection of hundreds of color name/numbers which I
>>> would add to this selection
>>>
>>>
>>> The custom formatting or editing of standard fields is handled inside
>>> javascript as far as I can see. I have found that the following allows you
>>> to edit the color field as text.
>>>
>>> <$edit-text tiddler=<<currentTiddler>> field=color type="text"
>>> tag="input"/>
>>>
>>> Placing the above in a tiddler tagged $:/tags/EditTemplate will allow
>>> you to edit it as text and use you color names in the editTemplate
>>> Or better use;
>>>
>>> <$list filter="[all[current]has:field[color]]" variable=nul>
>>> Color: <$edit-text tiddler=<<currentTiddler>> field=color type="text"
>>> tag="input"/>
>>> </$list>
>>>
>>> Of course you could replace or add a this with a select to select from
>>> the valid color names as well. See in $:/core/macros/colour-picker for a
>>> list of color names.
>>>
>>> There is room for more research but is this enough for now?
>>>
>>> Tones
>>>
>>>
>>> On Sunday, 25 July 2021 at 04:48:25 UTC+10 Si wrote:
>>>
>>>> Thanks Tones, if you have solution hidden away somewhere that would be
>>>> great!
>>>>
>>>> I know that I can add extra ways to view/edit the field, but I want to
>>>> actually replace the existing mechanism for editing the "color" field.
>>>>
>>>>
>>>> On Saturday, 24 July 2021 at 14:31:37 UTC+1 TW Tones wrote:
>>>>
>>>>> Si,
>>>>>
>>>>> I can have a look tomorrow, I have delved into this before, however
>>>>> just using your own view widget or edit-text widget will let you access
>>>>> the
>>>>> true value.
>>>>>
>>>>> Of course also {{!!color}} to view.
>>>>>
>>>>> You could write an edit template tiddler
>>>>> tagged $:/tags/EditTemplate that provides this text rather than stylised
>>>>> edit in edit mode.
>>>>>
>>>>> if has:field[color] then use edit-text widget.
>>>>>
>>>>> Regards
>>>>> Tones
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Saturday, 24 July 2021 at 01:26:47 UTC+10 Si wrote:
>>>>>
>>>>>> If you add the field "color" TiddlyWiki will replace the text-box for
>>>>>> editing the field value with a color-picker.
>>>>>>
>>>>>> In most cases this is very helpful, but I prefer to use color names
>>>>>> (e.g. papayawhip), so I don't want to see the color-picker.
>>>>>>
>>>>>> I can't figure out how to remove this feature, can anyone help me out?
>>>>>>
>>>>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/93b23f60-6ca3-43fe-836d-140555420ab5n%40googlegroups.com.