<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Blend Modes: Hue, Saturation, Color, and Luminosity with WPF 4.0</title>
	<atom:link href="http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/</link>
	<description>Yet another UX guy, working in WPF/Silverlight.</description>
	<lastBuildDate>Mon, 16 Jan 2012 15:35:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cplotts</title>
		<link>http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/comment-page-1/#comment-676</link>
		<dc:creator>cplotts</dc:creator>
		<pubDate>Sun, 06 Jun 2010 13:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.cplotts.com/?p=437#comment-676</guid>
		<description>&lt;a href=&quot;#comment-675&quot; rel=&quot;nofollow&quot;&gt;@Rashad&lt;/a&gt;:
I&#039;m not quite sure what you are asking, but I have implemented these blend modes so that the Opacity of the upper layer (B) can be modified to lessen the effect of blending (by changing the Opacity to a value less than 1.0).

It sounds like you are asking how to create an effect which doesn&#039;t blend two layers together but simply takes the Saturation out of whatever you are applying the effect to. If so, then you can use the the RGB to HSL conversion methods that are included in the effects above (Hue, Saturation, Luminosity, and Color) to do that.

Also, are you using WPF 3.5? If so, you might run into the PS 2.0 shader boundary (number of instructions). If you use WPF 4.0 and take advantage of PS 3.0 ... then realize that the software renderer in WPF 4.0 doesn&#039;t handle PS 3.0 shaders (meaning that if the video card doesn&#039;t support PS 3.0 ... WPF will do nothing).

Hope that helps.

Hmmm. I could quite easily write that Saturation effect. It 
would be kind of a nice effect to disable a control ... without making it transparent. Let me know if you want me to give it a whirl.</description>
		<content:encoded><![CDATA[<p><a href="#comment-675" rel="nofollow">@Rashad</a>:<br />
I&#8217;m not quite sure what you are asking, but I have implemented these blend modes so that the Opacity of the upper layer (B) can be modified to lessen the effect of blending (by changing the Opacity to a value less than 1.0).</p>
<p>It sounds like you are asking how to create an effect which doesn&#8217;t blend two layers together but simply takes the Saturation out of whatever you are applying the effect to. If so, then you can use the the RGB to HSL conversion methods that are included in the effects above (Hue, Saturation, Luminosity, and Color) to do that.</p>
<p>Also, are you using WPF 3.5? If so, you might run into the PS 2.0 shader boundary (number of instructions). If you use WPF 4.0 and take advantage of PS 3.0 &#8230; then realize that the software renderer in WPF 4.0 doesn&#8217;t handle PS 3.0 shaders (meaning that if the video card doesn&#8217;t support PS 3.0 &#8230; WPF will do nothing).</p>
<p>Hope that helps.</p>
<p>Hmmm. I could quite easily write that Saturation effect. It<br />
would be kind of a nice effect to disable a control &#8230; without making it transparent. Let me know if you want me to give it a whirl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rashad Rivera</title>
		<link>http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/comment-page-1/#comment-675</link>
		<dc:creator>Rashad Rivera</dc:creator>
		<pubDate>Sun, 06 Jun 2010 03:50:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.cplotts.com/?p=437#comment-675</guid>
		<description>Hello Cory,

  I have very little experience with HLSL so I&#039;m asking for some assistance in understanding.  All of the shaders you provided are good-to-go but I wanted to know if there is a way to control the output of some of them with a 0.0 to 1.0 valued variable.  For example, with the saturation effect, it would be nice to have a constant that I can change in .NET from 0 (which gives the normal color saturation), and change it to 1 (which means no color saturation at all).  

- Rashad Rivera</description>
		<content:encoded><![CDATA[<p>Hello Cory,</p>
<p>  I have very little experience with HLSL so I&#8217;m asking for some assistance in understanding.  All of the shaders you provided are good-to-go but I wanted to know if there is a way to control the output of some of them with a 0.0 to 1.0 valued variable.  For example, with the saturation effect, it would be nice to have a constant that I can change in .NET from 0 (which gives the normal color saturation), and change it to 1 (which means no color saturation at all).  </p>
<p>- Rashad Rivera</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory Plotts&#8217; Blog &#187; MIX10 Recap</title>
		<link>http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/comment-page-1/#comment-544</link>
		<dc:creator>Cory Plotts&#8217; Blog &#187; MIX10 Recap</dc:creator>
		<pubDate>Sun, 21 Mar 2010 13:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cplotts.com/?p=437#comment-544</guid>
		<description>[...] my favorite! I just so happened to have created a blend mode library for WPF &amp; Silverlight (see here and here). I really liked number 4 too which was: Sketch Early and Often. I don’t even have to [...]</description>
		<content:encoded><![CDATA[<p>[...] my favorite! I just so happened to have created a blend mode library for WPF &amp; Silverlight (see here and here). I really liked number 4 too which was: Sketch Early and Often. I don’t even have to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cplotts</title>
		<link>http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/comment-page-1/#comment-468</link>
		<dc:creator>cplotts</dc:creator>
		<pubDate>Thu, 18 Feb 2010 14:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.cplotts.com/?p=437#comment-468</guid>
		<description>Just tried it David ... unfortunately, it doesn&#039;t help. :(

Thanks for leaving a comment though! I&#039;m willing to try anything.

Another fellow contacted me via email and said that the differences are a result of Photoshop using a completely different model for computing what it calls hue/saturation/luminosity than what I am using. In this &lt;a href=&quot;http://commons.wikimedia.org/wiki/File:Hsl-and-hsv.svg&quot; rel=&quot;nofollow&quot;&gt;diagram&lt;/a&gt;, I am using the bottom middle ... and Photoshop is using the bottom right.

If he ever drafts the math to convert back and forth between that HSL model and RGB, I&#039;ll integrate it in ... and see if it matches!</description>
		<content:encoded><![CDATA[<p>Just tried it David &#8230; unfortunately, it doesn&#8217;t help. <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Thanks for leaving a comment though! I&#8217;m willing to try anything.</p>
<p>Another fellow contacted me via email and said that the differences are a result of Photoshop using a completely different model for computing what it calls hue/saturation/luminosity than what I am using. In this <a href="http://commons.wikimedia.org/wiki/File:Hsl-and-hsv.svg" rel="nofollow">diagram</a>, I am using the bottom middle &#8230; and Photoshop is using the bottom right.</p>
<p>If he ever drafts the math to convert back and forth between that HSL model and RGB, I&#8217;ll integrate it in &#8230; and see if it matches!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hollinshead</title>
		<link>http://www.cplotts.com/2009/11/29/blend-modes-hue-saturation-color-and-luminosity-with-wpf-4-0/comment-page-1/#comment-462</link>
		<dc:creator>David Hollinshead</dc:creator>
		<pubDate>Thu, 18 Feb 2010 01:39:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.cplotts.com/?p=437#comment-462</guid>
		<description>I have a line of code that may help. Sorry, I have not tested it with your solution as I don&#039;t have .NET 4.

In float3 RGBToHSL(float3 color), change the last if statement:
&lt;pre class=&quot;brush: csharp&quot;&gt;
if (hsl.x &lt; 0.0)
{
    // hsl.x += 1.0;
    hsl.x = 0 - hsl.x;
}
&lt;/pre&gt;

I think there was a problem when hue wraps round. 

Hope it helps - David</description>
		<content:encoded><![CDATA[<p>I have a line of code that may help. Sorry, I have not tested it with your solution as I don&#8217;t have .NET 4.</p>
<p>In float3 RGBToHSL(float3 color), change the last if statement:</p>
<pre class="brush: csharp">
if (hsl.x &lt; 0.0)
{
    // hsl.x += 1.0;
    hsl.x = 0 - hsl.x;
}
</pre>
<p>I think there was a problem when hue wraps round. </p>
<p>Hope it helps &#8211; David</p>
]]></content:encoded>
	</item>
</channel>
</rss>

