<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Projects Archives - rweber.net</title>
	<atom:link href="https://www.rweber.net/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.rweber.net/category/projects/</link>
	<description>trying to be a mile wide AND a mile deep</description>
	<lastBuildDate>Sun, 20 Jan 2019 03:18:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">37896774</site>	<item>
		<title>Non-Gray Grayscales</title>
		<link>https://www.rweber.net/projects/non-gray-grayscales/</link>
					<comments>https://www.rweber.net/projects/non-gray-grayscales/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 04 Feb 2019 13:00:58 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Toys and Games]]></category>
		<category><![CDATA[color]]></category>
		<guid isPermaLink="false">https://www.rweber.net/?p=40693</guid>

					<description><![CDATA[<div><img width="300" height="177" src="https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640-300x177.jpg" class="attachment-medium size-medium wp-post-image" alt="Colorful painted girl fading to black and white, image by Alexas_Fotos on Pixabay" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" fetchpriority="high" srcset="https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640-300x177.jpg 300w, https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640-150x88.jpg 150w, https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640.jpg 640w" sizes="(max-width: 300px) 100vw, 300px" /></div>
<p>If your darkest "neutral" is not gray, can you still generate a set of lighter shades that will work as neutrals? Presenting a utility I developed to do so.</p>
<p>The post <a href="https://www.rweber.net/projects/non-gray-grayscales/">Non-Gray Grayscales</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="177" src="https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640-300x177.jpg" class="attachment-medium size-medium wp-post-image" alt="Colorful painted girl fading to black and white, image by Alexas_Fotos on Pixabay" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" srcset="https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640-300x177.jpg 300w, https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640-150x88.jpg 150w, https://www.rweber.net/wp-content/uploads/2019/01/girl-2848057_640.jpg 640w" sizes="(max-width: 300px) 100vw, 300px" /></div><p>Early this year, <a href="https://css-tricks.com/re-pleasing-color-palettes/">CSS-Tricks</a> linked to a page on <a href="https://refactoringui.com/previews/building-your-color-palette/">Refactoring UI about building a color palette</a>. They discuss problems with some common color palette selection options and ways you can get stuck with (or introduce technical debt fixing) problems from not having enough colors with enough distinct shades. They say &#8220;it&#8217;s not uncommon to need as many as ten different colors with 5-10 shades each for a complex UI.&#8221; That is, a scale of neutrals (white to very dark gray with other grays in between), a scale of your primary color, and a scale of each of several accent colors &#8211; at least one accent color is a must, but you may need more to give user feedback such as warnings versus errors, success messages, or information.</p>
<p>I got to thinking about the color scheme of this website, and another site I built recently which I had trouble picking colors for. What if you&#8217;d like your &#8220;neutral&#8221; scale not to be grays? The text on this site is brown; or technically, it&#8217;s a very dark red, #300. If I lighten it in 20% increments with the fantastic <a href="https://www.hexcolortool.com/">Hex Color Tool</a>, I get the following:</p>
<div style="display:flex;">
<div style="padding:6px;background-color:#300;width:20%;color:#fcc;">#300</div>
<div style="padding:6px;background-color:#633;width:20%;color:#fcc;">#633</div>
<div style="padding:6px;background-color:#966;width:20%;color:#fcc;">#966</div>
<div style="padding:6px;background-color:#c99;width:20%;">#C99</div>
<div style="padding:6px;background-color:#fcc;width:20%;">#FCC</div>
</div>
<p>This is not leading to a usable &#8220;neutral&#8221; scale; a pale pink is simply not interchangeable with a light gray.</p>
<p>However, what if you simultaneously lightened and desaturated your initial color? Would that work? My first attempt converted the color to HSL, divided the distance between the saturation and 0 and between the lightness and 1 into equal pieces, and stepped them both simultaneously. To my surprise, while the lightest colors are certainly more usable as a neutral scale than the RGB lightening, the intermediate ones are significantly more saturated.</p>
<div style="display:flex;">
<div style="padding:6px;width:20%;color:#DAC8C8;background-color:#330000;">#330000</div>
<div style="padding:6px;width:20%;color:#DAC8C8;background-color:#810E0E;">#810E0E</div>
<div style="padding:6px;width:20%;color:#DAC8C8;background-color:#BC2F2F;">#BC2F2F</div>
<div style="padding:6px;width:20%;background-color:#C87E7E;">#C87E7E</div>
<div style="padding:6px;width:20%;background-color:#DAC8C8;">#DAC8C8</div>
</div>
<p>For a second try, I exponentially decayed the saturation, using the points <code>(0, initial_saturation)</code> and <code>(final_shade_step, 0.05)</code> to define the equation. That 0.05 was done by feel &#8212; I started with 0.001 and my brown grayed out <strong>way</strong> too fast; 0.01 was still too fast, but 0.1 seemed too slow. I went back and forth between 0.075 and 0.05 but ultimately the latter seemed better for a wider variety of starting colors.</p>
<div style="display:flex;">
<div style="padding:6px;width:20%;color:#D5CDCD;background-color:#330000;">#330000</div>
<div style="padding:6px;width:20%;color:#D5CDCD;background-color:#6F2020;">#6F2020</div>
<div style="padding:6px;width:20%;color:#D5CDCD;background-color:#995252;">#995252</div>
<div style="padding:6px;width:20%;background-color:#B29494;">#B29494</div>
<div style="padding:6px;width:20%;background-color:#D5CDCD;">#D5CDCD</div>
</div>
<p>It&#8217;s still not quite as desaturated as the plain hex lightening in the intermediate colors, but it&#8217;s more comparable and still a big improvement in the lightest colors.</p>
<p>When I tested my code, I found it worked great for fairly saturated starting colors. For less-saturated starts, though, the colors weren&#8217;t great OR my equation fell apart entirely and spat back junk. I could fix the latter with some min/max checks, but that was suboptimal &#8211; keeping the same saturation level throughout the scale. Instead, for starting colors where the saturation is under 55%, the saturation value at the final shade step is computed as 0.01 of the starting saturation value. That works much better. For example, taking a 50% saturated dark blue-green&#8230;</p>
<p>Min-max checks in place, but using same equation as above:</p>
<div style="display:flex;">
<div style="padding:6px;width:20%;color:#C5E9BE;background-color:#193913;">#193913</div>
<div style="padding:6px;width:20%;color:#C5E9BE;background-color:#367A29;">#367A29</div>
<div style="padding:6px;width:20%;color:#C5E9BE;background-color:#52BB3E;">#52BB3E</div>
<div style="padding:6px;width:20%;background-color:#8BD47D;">#8BD47D</div>
<div style="padding:6px;width:20%;background-color:#C5E9BE;">#C5E9BE</div>
</div>
<p>With the adjusted equation:</p>
<div style="display:flex;">
<div style="padding:6px;width:20%;color:#D0D9CF;background-color:#193913;">#193913</div>
<div style="padding:6px;width:20%;color:#D0D9CF;background-color:#3E6E35;">#3E6E35</div>
<div style="padding:6px;width:20%;color:#D0D9CF;background-color:#689B5F;">#689B5F</div>
<div style="padding:6px;width:20%;background-color:#9EB79A;">#9EB79A</div>
<div style="padding:6px;width:20%;background-color:#D0D9CF;">#D0D9CF</div>
</div>
<p>I added a similar cutoff point at 35% saturation, dropping the constant down to 0.001, although at that point the linear equation works quite well.</p>
<p>After all that, do you want to play?</p>
<h3 id="cns-embed">&#8220;Colorful Neutral&#8221; Color Scale Generator</h3>
<div id="cns-container" class="cns-container">
</div>
<p><script src="https://www.rweber.net/wp-content/uploads/2019/01/cns.js"></script></p>
<p>If you would like to peek or fool around with it, the code for this can be found in <a href="https://github.com/ReveWeber/colorful-neutral-scale">my GitHub colorful-neutral-scale repository</a>.</p>
<hr>
<p><small>Fade to black and white image by <a href="https://pixabay.com/en/girl-color-black-and-white-brush-2848057/">Alexas_Fotos on Pixabay</a>.</small></p>
<p>The post <a href="https://www.rweber.net/projects/non-gray-grayscales/">Non-Gray Grayscales</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/non-gray-grayscales/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">40693</post-id>	</item>
		<item>
		<title>My latest game project</title>
		<link>https://www.rweber.net/projects/latest-game-project/</link>
					<comments>https://www.rweber.net/projects/latest-game-project/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 17 Jul 2017 12:00:18 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[arena]]></category>
		<category><![CDATA[game development]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=40100</guid>

					<description><![CDATA[<div><img width="300" height="300" src="https://www.rweber.net/wp-content/uploads/2017/07/arena-300x300.png" class="attachment-medium size-medium wp-post-image" alt="arena" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" srcset="https://www.rweber.net/wp-content/uploads/2017/07/arena-300x300.png 300w, https://www.rweber.net/wp-content/uploads/2017/07/arena-150x150.png 150w, https://www.rweber.net/wp-content/uploads/2017/07/arena-768x768.png 768w, https://www.rweber.net/wp-content/uploads/2017/07/arena.png 1024w" sizes="(max-width: 300px) 100vw, 300px" /></div>
<p>Just a snapshot of a game in development, in its early stages.</p>
<p>The post <a href="https://www.rweber.net/projects/latest-game-project/">My latest game project</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="300" src="https://www.rweber.net/wp-content/uploads/2017/07/arena-300x300.png" class="attachment-medium size-medium wp-post-image" alt="arena" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2017/07/arena-300x300.png 300w, https://www.rweber.net/wp-content/uploads/2017/07/arena-150x150.png 150w, https://www.rweber.net/wp-content/uploads/2017/07/arena-768x768.png 768w, https://www.rweber.net/wp-content/uploads/2017/07/arena.png 1024w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div><p>I made a resolution this year to design and implement an original video game, even if it had to be quite a simple one. I have many ideas that are far too complicated to complete in a year and even the simplest had to be scaled back to seem doable, but I&#8217;m working away at it.</p>
<p>I want to record the game&#8217;s stages of development, and this is stage 1. It&#8217;s not so much playable yet, though it is interactive. It&#8217;s also not so much going to work on a phone, just for a warning.</p>
<p><canvas id="arenaCanvas" width="500" height="500" style="background: linear-gradient(70deg, rgba(52, 170, 19, 0.5), rgba(15, 133, 27, 0.25), rgba(45, 147, 16, 0.25), rgba(13, 115, 23, 0.5), rgba(16, 147, 29, 0.25)), linear-gradient(30deg, #34aa13, #2d9310, #076911, #0f851b, #34aa13); display: block; margin: 0 auto; border-radius: 250px; border: 9px double #422f1a;">[Visit my blog to fiddle with this]</canvas></p>
<p><script src="https://www.rweber.net/wp-content/uploads/2017/07/arena1.min_.js"></script></p>
<p>The post <a href="https://www.rweber.net/projects/latest-game-project/">My latest game project</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/latest-game-project/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">40100</post-id>	</item>
		<item>
		<title>Feedable Fish</title>
		<link>https://www.rweber.net/projects/feedable-fish/</link>
					<comments>https://www.rweber.net/projects/feedable-fish/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 16 Jan 2017 13:00:06 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[fishpond]]></category>
		<category><![CDATA[portfolio]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=40023</guid>

					<description><![CDATA[<div><img width="300" height="186" src="https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-300x186.jpg" class="attachment-medium size-medium wp-post-image" alt="animated fish feeding" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-300x186.jpg 300w, https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-768x476.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-150x93.jpg 150w, https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish.jpg 956w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div>
<p>Feedable fish who are somewhat attracted to your mouse pointer, now here and <a href="https://github.com/ReveWeber/fishpond-experiments">on Github</a>.</p>
<p>The post <a href="https://www.rweber.net/projects/feedable-fish/">Feedable Fish</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="186" src="https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-300x186.jpg" class="attachment-medium size-medium wp-post-image" alt="animated fish feeding" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-300x186.jpg 300w, https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-768x476.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish-150x93.jpg 150w, https://www.rweber.net/wp-content/uploads/2016/12/feeding-fish.jpg 956w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div><p>More progress on <a href="https://www.rweber.net/web-development/javascript/here-fishy-fishy/">the fishpond</a>! The fish are slightly attracted to the mouse pointer when it&#8217;s inside the canvas, and you can click to feed them, which attracts them more. They also got a tiny upgrade in attractiveness. They&#8217;re still twitchy and awkward but I have various thoughts on how to improve that situation.</p>
<p><canvas id="myCanvas" width="480" height="320" style="background: radial-gradient(#94daff, #dbf3ff); display: block; margin: 0 auto;">[Visit my blog to see the fish in action]</canvas></p>
<p><script src="/wp-content/uploads/2017/01/fishpond2.js"></script></p>
<p>Code for this is <a href="https://github.com/ReveWeber/fishpond-experiments">on Github</a>.</p>
<p>The post <a href="https://www.rweber.net/projects/feedable-fish/">Feedable Fish</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/feedable-fish/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">40023</post-id>	</item>
		<item>
		<title>Four Field Kono, take 1</title>
		<link>https://www.rweber.net/projects/four-field-kono-take-1/</link>
					<comments>https://www.rweber.net/projects/four-field-kono-take-1/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 07 Nov 2016 13:00:01 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Toys and Games]]></category>
		<category><![CDATA[game development]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39983</guid>

					<description><![CDATA[<div><img width="206" height="300" src="https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-206x300.jpg" class="attachment-medium size-medium wp-post-image" alt="Four Field Kono game in progress" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-206x300.jpg 206w, https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-768x1118.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono.jpg 703w, https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-103x150.jpg 103w" sizes="auto, (max-width: 206px) 100vw, 206px" /></div>
<p>Conversation about a new in-progress-but-also-already-tabled game; you can also skip it and just <a href="https://www.rweber.net/kono-1/">play Four Field Kono</a>.</p>
<p>The post <a href="https://www.rweber.net/projects/four-field-kono-take-1/">Four Field Kono, take 1</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="206" height="300" src="https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-206x300.jpg" class="attachment-medium size-medium wp-post-image" alt="Four Field Kono game in progress" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-206x300.jpg 206w, https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-768x1118.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono.jpg 703w, https://www.rweber.net/wp-content/uploads/2016/11/four-field-kono-103x150.jpg 103w" sizes="auto, (max-width: 206px) 100vw, 206px" /></div><p>I&#8217;ve <a href="https://www.rweber.net/kono-1/">added another game</a> at long last. I&#8217;m <em>calling</em> it Take 1 because I can think of numerous ways to improve it. I&#8217;m <em>posting</em> it as Take 1 because A) there&#8217;s no reasonable way forward without refactoring from the ground up, B) while none of my AI are terrifically difficult, they can be lively, and C) I have other projects in the works and no timeline for getting back to this one.</p>
<p>The story: once upon a time, I became <a href="http://www.revedreams.com/craftinggenerally/first-friday-17/">very interested</a> in games that can be played on some arrangement of up to four 4&#215;4 boards. That is, if you cut a checkers or chess board into quarters and use one or more pieces in some configuration, how many games can you play? A lot, as it turns out, especially if you&#8217;re a little loose in how you use the squares (e.g. to envision a mancala board out of a 4&#215;8 board, ignore all non-edge-squares and collect the 4 squares on each end into a single location).</p>
<p>My research brought up numerous board games I was unfamiliar with. When I decided to start implementing existing games on the way to designing my own, I went to that list and chose a game from Korea called <a href="https://en.wikipedia.org/wiki/Four_Field_Kono">Four Field Kono</a>. The rules are simple: you have a 4&#215;4 board and begin by filling half of it with light pieces and half with dark. All moves are orthogonal, and there are two types: slide a piece into an empty adjacent square, or jump a piece over another one of your own pieces onto an enemy piece, capturing that enemy piece. You win when there is no way your opponent could make another capture, which will either be because your opponent has only one piece remaining or because your opponent has no more legal moves.</p>
<p>This was a challenge mostly because it was my first significant AI. I had been thinking it was my first AI at all, but technically tic-tac-toe had an AI opponent. The manner in which the AI makes its decisions is similar for both games; there&#8217;s a &#8220;preference chain&#8221; of moves/tactics and it executes the first one it can. Tic-tac-toe&#8217;s AI was simplistic: win, block, center, random. Also, tic-tac-toe strategy was well known to me in advance.</p>
<p>Four Field Kono is much more sophisticated and I started much more blind. I ended up with four AI opponents, each using 6 or 7 of 8 tactics (including making a random move) in some order. You can read the source code for the strategy; no spoilers here.</p>
<p>If you&#8217;d like to try it out I&#8217;ve put it in my webspace: <a href="https://www.rweber.net/kono-1/">play Four Field Kono</a>.</p>
<p>The post <a href="https://www.rweber.net/projects/four-field-kono-take-1/">Four Field Kono, take 1</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/four-field-kono-take-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39983</post-id>	</item>
		<item>
		<title>Return of the Color Scheme Picker</title>
		<link>https://www.rweber.net/toys-and-games/return-color-scheme-picker/</link>
					<comments>https://www.rweber.net/toys-and-games/return-color-scheme-picker/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 11 Jul 2016 12:00:19 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Toys and Games]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[portfolio]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39924</guid>

					<description><![CDATA[<div><img width="204" height="300" src="https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-204x300.png" class="attachment-medium size-medium wp-post-image" alt="color scheme picker featuring the new additions" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-204x300.png 204w, https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-768x1127.png 768w, https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds.png 698w, https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-102x150.png 102w" sizes="auto, (max-width: 204px) 100vw, 204px" /></div>
<p>A new edition: now select up to five colors and have them highlighted and previewed below the options grid.</p>
<p>The post <a href="https://www.rweber.net/toys-and-games/return-color-scheme-picker/">Return of the Color Scheme Picker</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="204" height="300" src="https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-204x300.png" class="attachment-medium size-medium wp-post-image" alt="color scheme picker featuring the new additions" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-204x300.png 204w, https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-768x1127.png 768w, https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds.png 698w, https://www.rweber.net/wp-content/uploads/2016/07/color-preview-backgrounds-102x150.png 102w" sizes="auto, (max-width: 204px) 100vw, 204px" /></div><p>I got back to this sooner than I thought &#8211; and good thing, too, since I found a bug dating clear back to my <a href="https://www.rweber.net/web-development/javascript/flattening-color-layers-javascript/">color layer flattener</a> (not accounting for leading zeroes when converting to a hex string is a lot more noticeable once you are doing something with said hex string besides displaying it). You can read about the idea behind this in the <a href="https://www.rweber.net/web-development/javascript/color-scheme-picker-take-1/">previous color scheme picker post</a>.</p>
<p>You can now select up to five colors from the grid of fifteen and have those colors show as the highlight on the corresponding hex code and in boxes below against black and white backgrounds. You can actually select more than five but only the first five (left to right, top to bottom in the grid) will show up below. Have fun!</p>
<div id="csp-container" style="clear:left;" data-path="wp-content/uploads/2016/07">[visit my blog to see the picker in action]</div>
<p><script type="text/javascript" src="/wp-content/uploads/2016/07/jscsp-no-jquery.js"></script></p>
<p>Up-to-date code is available in the <a href="https://github.com/ReveWeber/color-scheme-picker">GitHub repo</a>. Thanks again to <a href="https://github.com/bgrins/spectrum">Brian Grinstead</a> and <a href="https://github.com/davidmerfield/randomColor">David Merfield</a> for the color utilities they&#8217;ve written and made freely available.</p>
<p>The post <a href="https://www.rweber.net/toys-and-games/return-color-scheme-picker/">Return of the Color Scheme Picker</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/toys-and-games/return-color-scheme-picker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39924</post-id>	</item>
		<item>
		<title>Sweeping the Minefield</title>
		<link>https://www.rweber.net/toys-and-games/sweeping-the-minefield/</link>
					<comments>https://www.rweber.net/toys-and-games/sweeping-the-minefield/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 04 Jul 2016 12:00:50 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Toys and Games]]></category>
		<category><![CDATA[game development]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39910</guid>

					<description><![CDATA[<div><img width="229" height="300" src="https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-229x300.png" class="attachment-medium size-medium wp-post-image" alt="Minefield screenshot" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-229x300.png 229w, https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-768x1007.png 768w, https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot.png 781w, https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-114x150.png 114w" sizes="auto, (max-width: 229px) 100vw, 229px" /></div>
<p>I cloned Minesweeper! I call it Dolly. Or maybe Minefield. Anyway, you can read a bit about it or <a href="https://www.rweber.net/minefield/">just go play it</a>.</p>
<p>The post <a href="https://www.rweber.net/toys-and-games/sweeping-the-minefield/">Sweeping the Minefield</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="229" height="300" src="https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-229x300.png" class="attachment-medium size-medium wp-post-image" alt="Minefield screenshot" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-229x300.png 229w, https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-768x1007.png 768w, https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot.png 781w, https://www.rweber.net/wp-content/uploads/2016/06/minefield-screenshot-114x150.png 114w" sizes="auto, (max-width: 229px) 100vw, 229px" /></div><p>I&#8217;m on a mission to reduce the number of incomplete games and other interactive programs I have in progress. June&#8217;s finish was a clone of Minesweeper you can find at <a href="https://www.rweber.net/minefield/">rweber.net/minefield/</a>.</p>
<p>I won&#8217;t expound on this in great detail, but I&#8217;ll share some features that are either nonobvious or that I&#8217;m particularly pleased with.</p>
<ul>
<li>I added a feature: I&#8217;m not a mine-flagger by nature but it is sometimes necessary to know how many mines remain to deduce their locations. To assist with that the game shows you the number of unopened squares in addition to the number of flagged mines.</li>
<li>There&#8217;s no jQuery, just vanilla JavaScript. Except for the AJAX calls this was unexpectedly easy to do.</li>
<li>There&#8217;s a high score list (well, low score list) stored in a database and accessed via AJAX. This took some doing because apparently in the short while since the last time I wrote something that interacted with a database I forgot everything I ever knew. And decided to give some functions inputs which don&#8217;t take inputs. And thought I could parametrize the database table in a PDO prepared statement.</li>
<li>New games can also be started with AJAX &#8211; the buttons across the bottom of the minefield don&#8217;t reload the page.</li>
<li>I created a custom icon font with four <a href="http://fontawesome.io/">Font Awesome</a> icons for the clock, mines, flags, and an X you get if you flag a wrong square and then lose. I should say <a href="https://icomoon.io/">IcoMoon</a> created the font; it was remarkably easy and the Unicode values stayed the same as in Font Awesome as a whole.</li>
<li>When you click a square that has no mine and no neighboring mines, the space of contiguous blank squares and their immediate numbered neighbors opens with a ripple effect. This involved a whole lot of setTimeouts, partially because every direction of neighbor had to be accounted for separately in the two-dimensional array representing the board &#8211; there may be a better way to do that but I&#8217;ll have to refresh myself on data structures.</li>
<li>The timer pauses when you leave the tab or window in which you&#8217;re playing the game. Instead of trying to do something fancy with stopping the setInterval, there&#8217;s just an if statement that only increments the counter if document.hidden is false (and your game is still in progress).</li>
<li>The first-clicked square is never a mine. This is accomplished by shuffling an array of pairs of numbers that collectively represent the grid (at whatever size desired), and then copying the first n values and the second n values into two other arrays, where n is the number of mines. If the first square clicked has coordinates in the first array, the second array is used as the mine locations. Otherwise the first array is used. The rest of game setup (building the array of objects that represents the game board) happens at that point.</li>
</ul>
<p>Since I intend to make game development a major focus &#8211; and it won&#8217;t always involve programming &#8211; I&#8217;ve created <a href="https://www.rweber.net/category/game-development/">a new category for it</a>. That category will include material that&#8217;s not a game itself (like the animated fishpond) but which I have pursued because of its relevance to game development. <a href="https://www.rweber.net/tag/games/">The tag &#8220;games&#8221;</a> will be applied to posts that include or link to playable games (mine or others&#8217;).</p>
<p>The post <a href="https://www.rweber.net/toys-and-games/sweeping-the-minefield/">Sweeping the Minefield</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/toys-and-games/sweeping-the-minefield/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39910</post-id>	</item>
		<item>
		<title>Touring a New(ish) Site</title>
		<link>https://www.rweber.net/projects/touring-new-site/</link>
					<comments>https://www.rweber.net/projects/touring-new-site/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 13 Jun 2016 12:00:34 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugins]]></category>
		<category><![CDATA[WordPress theming]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39593</guid>

					<description><![CDATA[<div><img width="185" height="300" src="https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640-185x300.png" class="attachment-medium size-medium wp-post-image" alt="illustration of woman pointing, from Pixabay" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640-185x300.png 185w, https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640-93x150.png 93w, https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640.png 395w" sizes="auto, (max-width: 185px) 100vw, 185px" /></div>
<p>We recently launched an extensive WordPress site, so let me show you around. This is not a discussion of design, but rather of all of the pieces I put together: CSS, custom functionality, plugins.</p>
<p>The post <a href="https://www.rweber.net/projects/touring-new-site/">Touring a New(ish) Site</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="185" height="300" src="https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640-185x300.png" class="attachment-medium size-medium wp-post-image" alt="illustration of woman pointing, from Pixabay" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640-185x300.png 185w, https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640-93x150.png 93w, https://www.rweber.net/wp-content/uploads/2016/04/mademoiselle-307923_640.png 395w" sizes="auto, (max-width: 185px) 100vw, 185px" /></div><p>What turned out to be my last major job before starting at King Arthur was <a href="http://www.secondgrowth.org">a new website for Second Growth</a>, a local nonprofit dedicated to treatment, recovery, and prevention of substance abuse in adolescents and young adults. Before I came on board with Aquilino Arts my partner had set them up with a lovely Joomla site, but it was hard to update in terms of both content and software. It was time to shift to WordPress, and clean up and reorganize a little at the same time. I was involved in the organization &#8211; though we stuck fairly close to the previous structure &#8211; and gave feedback and input on the design, but my main job was the technical aspects. I wanted to discuss them here because it is our most sophisticated site to date and it gives a fairly thorough overview of my methods for site construction.</p>
<p>By the way, I have a <a href="https://www.pinterest.com/aquilinoarts/wordpress-plugins-we-use/">Pinterest board devoted to plugins we use</a>, which you can take as recommendations.</p>
<p><a href="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite.png" rel="attachment wp-att-39690"><img loading="lazy" decoding="async" src="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite-453x1024.png" alt="screencap of front page of secondgrowth.org" width="453" height="1024" class="alignleft size-large wp-image-39690" srcset="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite-453x1024.png 453w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite-133x300.png 133w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite-768x1737.png 768w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite-66x150.png 66w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthFullSite.png 905w" sizes="auto, (max-width: 453px) 100vw, 453px" /></a> The front page starts with a mosaic; the left half has a YouTube video and a mini-menu, the right half is split into 3 pieces whose contents can be changed from within the Customizer. The theme is set to use two menus, intended to be the mini-menu and a full menu. The mini-menu includes a link to the full menu; the full menu appears in the footer, which is where the link goes, but if you have JavaScript, it hijacks the link and pops the full menu up in a lightbox (the method is shown almost exactly in <a href="https://www.rweber.net/web-development/wordpress/ajax-in-wp-a-simple-example/">my post about AJAX in WordPress</a>).</p>
<p>Below the mosaic and a divider band, there are three more spots whose contents can be set in the Customizer. In every case the options are a page, a specific blog post, or the latest blog post. The footer includes not only the full menu but a 2-up slider of donor logos. The gallery uses <a href="https://wordpress.org/plugins/media-library-assistant/">Media Library Assistant</a> to allow logos to be selected by categorizing them appropriately on the back end and is set to have two columns and random order. <a href="http://flickity.metafizzy.co/">Flickity</a> applies itself after page load and turns each column into a panel of the slider. All gallery/slider and lightbox functionality (which is via <a href="http://www.jacklmoore.com/colorbox/">Colorbox</a>) is in a custom plugin so it can persist should they change their theme down the road. The choice of Flickity and Colorbox is semi-arbitrary; I&#8217;m familiar with both of them and they do what I want. I&#8217;ve never written about Colorbox here, but <a href="https://www.rweber.net/tag/flickity/">I&#8217;ve written fairly extensively about Flickity</a>.</p>
<p><a href="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage.png" rel="attachment wp-att-39691"><img loading="lazy" decoding="async" src="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage-424x1024.png" alt="screencap of blog page of secondgrowth.org" width="424" height="1024" class="alignleft size-large wp-image-39691" srcset="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage-424x1024.png 424w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage-124x300.png 124w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage-768x1853.png 768w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage-62x150.png 62w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthInteriorPage.png 849w" sizes="auto, (max-width: 424px) 100vw, 424px" /></a> On interior pages the mini-menu appears as the top-of-page menu; the logo gets you back home if you don&#8217;t want to use the full menu popup. Certain content is accordion-folded, which is also provided by the custom plugin but is hand-coded. Different pages have different sidebar content via <a href="https://wordpress.org/plugins/display-widgets/">Display Widgets</a>, chosen as the least awkward of the options. Almost all of them have a donate button and contact link; most have a two-column gallery of donor logos; a couple have a still of the home page&#8217;s YouTube video that lightboxes up into a watchable video. One has 1-up slider of photos, chosen via Media Library Assistant&#8217;s tagging system.</p>
<p>The contact form is from <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, because of the option of <a href="http://contactform7.com/selectable-recipient-with-pipes/">Selectable Recipient with Pipes</a>, including the ability to use the pre-pipe content by prefixing the label with _raw_. The event calendar is <a href="https://wordpress.org/plugins/event-organiser/">Event Organiser</a>, chosen because it does recurring events and is developer-friendly. I didn&#8217;t end up turning off the original CSS, but I found it reassuring that the developer included that option. It provides for per-category colors, which we used to make one-off events stand out from weekly recurring events, and also produces the lists of upcoming events that appear on the home page (set to show only the next instance of any recurring event) and in the sidebar of one of the interior pages.</p>
<p>There are two custom post types aside from contact forms and events, both created and given custom taxonomies using <a href="https://wordpress.org/plugins/custom-post-type-ui/">Custom Post Type UI</a>. One is testimonials, which currently only exist in the sidebar of one page (a single random one selected and shown by <a href="https://wordpress.org/plugins/flexible-posts-widget/">Flexible Posts Widget</a> with a custom template &#8211; and by the way you can get <a href="https://github.com/ReveWeber/flexible-posts-widget">all my custom FPW templates on GitHub</a>). The other is resources. The resources archive and news (blog) archive look similar: they are topped with buttons for each category (or topic, the resource-specific hierarchical taxonomy) and for the whole archive. These buttons are coded into the archive templates. The list of all resources actually excludes one of the categories; resource archives also display alphabetically by title instead of by date and with more allowed per page.</p>
<p>The news archive shows the featured image and an excerpt; the resource archive shows the full content with no image. Featured images aren&#8217;t set to automatically show on any of the individual posts or pages; they are used for the front page featured content and news archive only.</p>
<p><a href="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthNarrow.png" rel="attachment wp-att-39692"><img loading="lazy" decoding="async" src="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthNarrow-154x1024.png" alt="screencap of contact page of secondgrowth.org at a narrow width" width="154" height="1024" class="alignleft size-large wp-image-39692" srcset="https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthNarrow-154x1024.png 154w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthNarrow-45x300.png 45w, https://www.rweber.net/wp-content/uploads/2016/04/SecondGrowthNarrow.png 308w" sizes="auto, (max-width: 154px) 100vw, 154px" /></a> The theme is fully responsive, and below a certain width the two-column donor logo galleries are hidden so as not to make the page infinitely long. When at &#8220;full size&#8221; the right sidebar is positioned and sized via <code>display: table-cell</code>. This caused some problems on Firefox with the pages with the video still in the sidebar, where the sidebar was displaying far wider than it was set to (35%). The fix was to set <code>width: 100%</code> on the still (in addition to the <code>max-width: 100%</code> set on all images in the theme). It was tricky to repair because my browsers have gotten very tenacious about using the old CSS file, regardless of hard refresh or cache clearing, until I change the version number. I&#8217;d switched to CSS tables because I was having the same problem in Flexbox, but since then have determined the same fix would have worked for Flexbox.</p>
<p>Using CSS tables or Flexbox was important for getting the main content and sidebar to be the same height, since the leafy divider is actually a small vertically-repeating background image on the sidebar, transparent beyond the leaves on the sidebar side and with solid white background (covering the translucent green background of the sidebar) on the main content side. When the sidebar drops below we switch the image and its positioning and repeat settings.</p>
<p>Originally the footer used CSS columns, as well as the sidebar when it dropped below but had width enough for multiple widgets, but then I discovered Flickity doesn&#8217;t play well with CSS columns. <em>At all.</em> I had crazy spillover outside the Flexbox viewport that I couldn&#8217;t figure out how to fix. No more CSS columns; they are now done the old fashioned way with percentage width and floating.</p>
<p>The behind the scenes plugins in the site are <a href="https://wordpress.org/plugins/wp-smushit/">WP Smush</a> for image optimization, <a href="https://wordpress.org/plugins/wp-spamshield/">WP-SpamShield</a> for comment spam elimination, <a href="https://wordpress.org/plugins/google-analytics-for-wordpress/">Google Analytics by Yoast</a>, and <a href="https://wordpress.org/plugins/w3-total-cache/">W3 Total Cache</a> for caching. With such an image-heavy site both image optimization and caching are key elements. I didn&#8217;t use <a href="https://wordpress.org/plugins/wp-fastest-cache/">WP Fastest Cache</a> because the free version has to be cleared from the hosting account if you haven&#8217;t just published a post or page &#8211; changing the featured items in the front page won&#8217;t do it. W3TC doesn&#8217;t detect changes in the front page but you can clear its cache from a button at the top of any of its pages.</p>
<p>The post <a href="https://www.rweber.net/projects/touring-new-site/">Touring a New(ish) Site</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/touring-new-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39593</post-id>	</item>
		<item>
		<title>Here fishy fishy</title>
		<link>https://www.rweber.net/projects/here-fishy-fishy/</link>
					<comments>https://www.rweber.net/projects/here-fishy-fishy/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 30 May 2016 12:00:02 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[fishpond]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39895</guid>

					<description><![CDATA[<div><img width="300" height="200" src="https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-300x200.png" class="attachment-medium size-medium wp-post-image" alt="screenshot of my JS/canvas fishpond" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-300x200.png 300w, https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-768x513.png 768w, https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-150x100.png 150w, https://www.rweber.net/wp-content/uploads/2016/05/fishpond1.png 964w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div>
<p>I'm working on my fishpond! With JavaScript and the HTML5 canvas element. Here's my first solid attempt.</p>
<p>The post <a href="https://www.rweber.net/projects/here-fishy-fishy/">Here fishy fishy</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="200" src="https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-300x200.png" class="attachment-medium size-medium wp-post-image" alt="screenshot of my JS/canvas fishpond" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-300x200.png 300w, https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-768x513.png 768w, https://www.rweber.net/wp-content/uploads/2016/05/fishpond1-150x100.png 150w, https://www.rweber.net/wp-content/uploads/2016/05/fishpond1.png 964w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div><p>I love <a href="http://abowman.com/google-modules/fish/">aBowman&#8217;s fish gadget</a>, but it&#8217;s Flash, which seems to be more restricted every year. Nowadays it won&#8217;t even run for longer than a minute or so without clicking a play button.</p>
<p>Recreating an interactive fishpond with HTML, CSS, and JavaScript seemed like an excellent way to learn the associated skills. I started with <a href="https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript">MDN&#8217;s JS/canvas Breakout tutorial</a> and then made the ball more interesting, and then plural. Here&#8217;s what I have so far:</p>
<p><canvas id="myCanvas" width="480" height="320" style="background: radial-gradient(#94daff, #dbf3ff); display: block; margin: 0 auto;">[Visit my blog to see the fish in action]</canvas></p>
<p><script src="/wp-content/uploads/2016/05/fishpond1.js"></script></p>
<p>This came together amazingly fast, but I expect every additional improvement will take longer than the last &#8211; more natural movement and appearance in particular. It has been a highly enjoyable challenge so far, though.</p>
<p>You can monitor the progress and grab this and other code on <a href="https://github.com/ReveWeber/fishpond-experiments">my GitHub</a>. I can&#8217;t improve on the MDN tutorial, so (for now at least) I&#8217;ll just be showing results.</p>
<p>The post <a href="https://www.rweber.net/projects/here-fishy-fishy/">Here fishy fishy</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/here-fishy-fishy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39895</post-id>	</item>
		<item>
		<title>A color scheme picker, take 1</title>
		<link>https://www.rweber.net/projects/color-scheme-picker-take-1/</link>
					<comments>https://www.rweber.net/projects/color-scheme-picker-take-1/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 23 May 2016 12:00:21 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[color]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39873</guid>

					<description><![CDATA[<div><img width="300" height="180" src="https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-300x180.jpg" class="attachment-medium size-medium wp-post-image" alt="collage of color schemes generated with my interactive utility" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-300x180.jpg 300w, https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-768x461.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-150x90.jpg 150w, https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage.jpg 1000w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div>
<p>A non-Photoshop way to create unified color schemes with tints and shades - or just a fun little toy utility.</p>
<p>The post <a href="https://www.rweber.net/projects/color-scheme-picker-take-1/">A color scheme picker, take 1</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="300" height="180" src="https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-300x180.jpg" class="attachment-medium size-medium wp-post-image" alt="collage of color schemes generated with my interactive utility" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-300x180.jpg 300w, https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-768x461.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage-150x90.jpg 150w, https://www.rweber.net/wp-content/uploads/2016/05/color-scheme-collage.jpg 1000w" sizes="auto, (max-width: 300px) 100vw, 300px" /></div><p>After my <a href="https://www.rweber.net/web-development/javascript/flattening-color-layers-javascript/">JS Color Layer Flattener</a> and research for <a href="https://www.rweber.net/web-development/css/web-design-non-designer/">Web Design for the Non-Designer</a>, I decided to implement the color scheme selection process outlined in WebdesignerDepot&#8217;s article <a href="http://www.webdesignerdepot.com/2009/12/how-to-get-a-professional-look-with-color/">How to Get a Professional Look With Color</a>: choose up to five colors; increase to fifteen by adding the result of overlaying each color with translucent black or white; unify the fifteen by overlaying all with a common translucent color. Instead of manual input like the layer flattener, I went with Brian Grinstead&#8217;s color picker <a href="https://github.com/bgrins/spectrum">Spectrum</a>, except for the black and white layers. The colors populate on load via David Merfield&#8217;s <a href="https://github.com/davidmerfield/randomColor">Random Color</a> script, something I pinned a while ago but never used. I do use the blending part of my <a href="https://github.com/ReveWeber/js-color-layer-flattener">color layer flattener</a> to compute hex values for the fifteen resulting colors.</p>
<p>Try it out!</p>
<div id="csp-container" data-path="wp-content/uploads/2016/05">[visit my blog to see the picker in action]</div>
<p><script type="text/javascript" src="/wp-content/uploads/2016/05/jscsp-no-jquery.js"></script></p>
<p>To use it yourself there are two pieces you need: jscsp-form.html and either jscsp-complete.js or jscsp-no-jquery.js. The form includes Spectrum&#8217;s CSS and both the scripts include both Spectrum and Random Color; jscsp-complete.js includes jQuery, as you might guess, so use jscsp-no-jquery.js if your site already loads jQuery. At the moment the <a href="https://github.com/ReveWeber/color-scheme-picker">GitHub repo for this</a> is slightly behind CSS-wise but not functionality-wise.</p>
<p>To use: place a div with <code>id="csp-container"</code> in your page. If the file jscsp-form.html is not at the root of your webpage, assign the container div a data-path attribute with the URL between the domain and jscsp-form.html. For example, for <code>example.com/gadgets/color/jscsp-form.html</code> you would use <code>data-path="gadgets/color"</code>. Including or excluding slashes on each end is okay. Call jscsp-complete.js or jscsp-no-jquery.js sometime after the container div.</p>
<p>My intention is to come back to this and add a means to select, say, five of the fifteen resultant colors and have them appear by themselves underneath the current contents, perhaps against both black and white backgrounds.</p>
<p>The post <a href="https://www.rweber.net/projects/color-scheme-picker-take-1/">A color scheme picker, take 1</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/color-scheme-picker-take-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39873</post-id>	</item>
		<item>
		<title>Flattening Color Layers with JavaScript</title>
		<link>https://www.rweber.net/projects/flattening-color-layers-javascript/</link>
					<comments>https://www.rweber.net/projects/flattening-color-layers-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Rebecca]]></dc:creator>
		<pubDate>Mon, 16 May 2016 12:00:17 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Toys and Games]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[portfolio]]></category>
		<guid isPermaLink="false">http://www.rweber.net/?p=39671</guid>

					<description><![CDATA[<div><img width="225" height="300" src="https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink-225x300.jpg" class="attachment-medium size-medium wp-post-image" alt="Rainbow Cake (both cake and photo) by Dabbisch on Deviantart [CC BY-NC-ND 3.0]" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink-225x300.jpg 225w, https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink-112x150.jpg 112w" sizes="auto, (max-width: 225px) 100vw, 225px" /></div>
<p>I wrote a little JavaScript program to calculate the displayed color when up to two translucent layers are displayed on an opaque background. It's a toy, but a fun one!</p>
<p>The post <a href="https://www.rweber.net/projects/flattening-color-layers-javascript/">Flattening Color Layers with JavaScript</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img width="225" height="300" src="https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink-225x300.jpg" class="attachment-medium size-medium wp-post-image" alt="Rainbow Cake (both cake and photo) by Dabbisch on Deviantart [CC BY-NC-ND 3.0]" style="float:left; margin-right:16px; margin-bottom:16px;" decoding="async" loading="lazy" srcset="https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink-225x300.jpg 225w, https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink.jpg 768w, https://www.rweber.net/wp-content/uploads/2016/04/rainbow_cake_by_dabbisch-d5gbink-112x150.jpg 112w" sizes="auto, (max-width: 225px) 100vw, 225px" /></div><p>A while ago I was trying to find an appropriate opaque fallback color for a translucent background color. Although after some thought I understand what the method is to calculate such a thing, at the time I just did a search and came across <a href="https://www.viget.com/articles/equating-color-and-transparency">an article by Lance Gutin relating transparency and color for grayscale</a>. I thought I might expand it to full-color, and after little time on the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/">Mozilla Development Network</a> and a lot in <a href="http://stackoverflow.com/">Stack Overflow</a> and <a href="http://brackets.io/">Brackets</a>, I have a little utility for you. You can use it here or <a href="https://github.com/ReveWeber/js-color-layer-flattener">grab it on GitHub.</a></p>
<div id="jsclf-container" data-path="wp-content/uploads/2016/04" style="clear:left;"></div>
<p><script type="text/javascript" src="/wp-content/uploads/2016/04/jsclf.js"></script></p>
<p>Since the arithmetic turned out to be straightforward and my need for this sort of calculation is infrequent, this project turned more into a way to practice non-DOM-manipulation and plain-vanilla JavaScript. My goal was for any valid color specification syntax to be acceptable, and maybe for it to be even more forgiving than that. I found the MDN pages on <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value">the color CSS data type</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions">regular expressions in JavaScript</a> most helpful.</p>
<h3>Mathity Math</h3>
<p>The simplest calculation is on an opaque background, where you take a weighted average of the color values. If the alpha of your overlay color is set to 0.8, to find the red value of the color you see (the composite color), you&#8217;ll calculate <code>0.8*(red value of overlay) + (1 - 0.8)*(red value of background)</code>. Do that for all three color channels and you have the code for the composite color. You can make this calculation for some opacities via the <a href="http://meyerweb.com/eric/tools/color-blend/#:::hex">Color Blender from Eric Meyer</a> (opacity must be a fraction with denominator less than or equal to 11).</p>
<p>When you add translucency as an option for the background the arithmetic increases in length but not really in complexity: <a href="https://www.w3.org/TR/2003/REC-SVG11-20030114/masking.html#SimpleAlphaBlending">the spec for simple alpha blending or compositing</a> (which applies to both SVG and CSS) simply takes a doubly-weighted average, though it does not take the color underneath the background into account.</p>
<p>Here&#8217;s the fully written out calculation, for the red channel:<br />
<code>(composite alpha)*(composite red) = (1 - overlay alpha)*(background alpha)*(background red) + (overlay alpha)*(overlay red)</code><br />
The composite color&#8217;s alpha value will be <code>1 - (1 - overlay alpha)*(1 - background alpha)</code>. If either background or overlay is opaque, the composite will be opaque. If the background is opaque the equation simplifies to the one we had previously; if the overlay is opaque it simplifies to <code>composite red = overlay red</code>.</p>
<p>A translucent background on an opaque bottom layer (the tallest stack I was interested in manipulating) can be dealt with in two steps: average the background and the bottom layer and then average that with the overlay.</p>
<p>Turns out that calculation is the simplest of the bunch, though, and extracting the color information from the assorted kinds of input permitted is much more complicated. I&#8217;ll leave that story to the code itself, though.</p>
<hr>
<p><small>Rainbow Cake (both cake and photo) by <a href="http://dabbisch.deviantart.com/art/Rainbow-Cake-329742128">Dabbisch on Deviantart</a> [<a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">CC BY-NC-ND 3.0</a>].</small></p>
<p>The post <a href="https://www.rweber.net/projects/flattening-color-layers-javascript/">Flattening Color Layers with JavaScript</a> appeared first on <a href="https://www.rweber.net">rweber.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.rweber.net/projects/flattening-color-layers-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39671</post-id>	</item>
	</channel>
</rss>
