<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=7461&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Simple color selector using Yad]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=7461</link>
		<description><![CDATA[The most recent posts in Simple color selector using Yad.]]></description>
		<lastBuildDate>Tue, 14 Oct 2025 20:59:29 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Simple color selector using Yad]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=58596#p58596</link>
			<description><![CDATA[<p>We were talking about this on IRC and it seemed handy enough to be worth posting<br />a quick how-to for future reference. Yad has a built-in widget for color selection<br />based off the gtk color-selector, it looks almost identical to gcolor2 and the<br />Mate-color-selection utility. It&#039;s got an eyedropper for selecting color on your screen.</p><p><span class="bbc">yad --color</span> in terminal gets you the basic version. But there are other options<br />available with this command, see the yad man page for (most of) them. If you want<br />the color swatches you can use <span class="bbc">--gtk-palette</span> but I don&#039;t find them to be<br />too useful. The <span class="bbc">--palette</span> command can be used to pull up a palette file and<br />display the colors and their code in a drop down menu, and if you want the gui to<br />start every time with that dropdown already expanded, then add <span class="bbc">--expand-palette</span><br />to it as well. The --palette command by default uses <span class="bbc">/etc/X11/rgb.txt</span> for a<br />palette file unless a different one is specified by adding a path to the command :<br /><span class="bbc">--palette=/path/to/file.txt</span>, so it&#039;s possible to make a custom palette file, I made<br />one for my theme, but you have to follow the format in rgb.txt closely.</p><p>And there are some of the normal operators you can use too, to add a window title or<br />an icon, borders, etc. Here&#039;s the command i&#039;m using:</p><div class="codebox"><pre><code>yad --color --title=&#039;Color Selection&#039; --window-icon=style --borders=15 --palette --expand-palette</code></pre></div><p>If you want to add the ability for copying a selected color code into your clipboard,<br />you can install <span class="bbc">xsel</span> and then pipe it to the clippy:</p><div class="codebox"><pre><code>yad --color --title=&#039;Color Selection&#039; --window-icon=style --borders=15 --palette --expand-palette | xsel -ib</code></pre></div><p>Simple .desktop, drop it in ~/.local/share/applications to get a menu entry:</p><div class="codebox"><pre><code>[Desktop Entry]
Name=Color Selection
Comment=Choose colors from the palette or the screen
Exec=sh -c &quot;yad --color --title=&#039;Color Selection&#039; --window-icon=style --borders=15 --palette --expand-palette | xsel -ib&quot;
Icon=style
Terminal=false
Type=Application
Categories=Graphics; </code></pre></div><p>And that gets you this:<br /><span class="postimg"><img src="https://imgdump5.novarata.net/okavt0.png" alt="okavt0.png" /></span></p><p>Miyolinux has some cool videos on youtube about doing this and making menu entries for it. <img src="http://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Tue, 14 Oct 2025 20:59:29 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=58596#p58596</guid>
		</item>
	</channel>
</rss>
