On Sunday, August 11, 2019 at 11:07:59 AM UTC-7, MagoArcade wrote:
>
> How can I insert a small color picker into a tiddler and have it output to 
> R,G,B format. The standard color picker has way too much associated with it 
> (Doc link 
> <https://tiddlywiki.com/static/colour-picker%2520Macro%2520(Example%25201).html>).
>  
> eg:
> All I really want is the button at the bottom, next to the text box. 
> Also, I'm needing a way to save it to a field in this format:
> 198,3,7
> i.e. RGB in decimal
>

The "button at the bottom" is actually an HTML input, with type="color", 
and if you dig into the TWCore "colour-picker" code 
($:/core/macros/colour-picker), you will find this line:

<$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/>

This creates the button you want.  However... the actual appearance AND 
function of the color input depends your specific platform and browser.  If 
your browser doesn't support the color button directly, it may render as a 
regular input field into which you can TYPE the color value.  Of course, 
you should change the target tiddler name to the title of the tiddler in 
which you want the color selection to be stored.

Unfortunately, this will only achieve half your desired goal.  The problem 
is that the browser-supplied HTML control will ONLY write the chosen color 
using a CSS-compatible *hexadecimal* value (e.g., "#rrggbb"), rather than 
the comma-separated decimal R,G,B values you want.

For more details, see 
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color

enjoy,
-e
Eric Shulman
TiddlyTools: "Small Tools for Big Ideas" (tm) http://tiddlytools.github.io/
InsideTiddlyWiki: The Missing Manuals

(NOTE NEW HOSTING LOCATION)


 

-- 
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/502d3e16-8144-4bdc-b798-f11b3b54ec86%40googlegroups.com.

Reply via email to