<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: Colour Theory and HSV Contrast</title>
      <link>http://ask.metafilter.com/83559/Colour-Theory-and-HSV-Contrast/</link>
      <description>Comments on Ask MetaFilter post Colour Theory and HSV Contrast</description>
	  	  <pubDate>Wed, 13 Feb 2008 12:03:53 -0800</pubDate>
      <lastBuildDate>Wed, 13 Feb 2008 12:03:53 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Colour Theory and HSV Contrast</title>
  	<link>http://ask.metafilter.com/83559/Colour-Theory-and-HSV-Contrast</link>	
  	<description>Colour Theory: I have an ActionScript 3 project that has models that wear changeable clothing, where the style and colour of the clothing can change.  The clothing is composed of several layers (colour, border, details) and there are preset colours for the &apos;colour&apos; layer.  When the colour layer changes I need to automatically calculate a contrasting colour for the border layer.  I know this involves the HSV colour space but I&apos;m struggling to get good results. The mechanic is simple, click to change the clothing on the model. Each item of clothing is composed of several layers:&lt;br&gt;
&lt;br&gt;
- colour, the main shape of the piece of clothing&lt;br&gt;
- border, the outline of the element, showing folds, creases, seams, etc&lt;br&gt;
- details, extra elements like buttons, zippers, etc&lt;br&gt;
&lt;br&gt;
There are a set of predefined colours for the colour layer so changing the colour of the clothing should result in changing the colour of the border.  By default the border is a dark colour, somewhere between black and white.  If the clothing changes to a light colour, the dark border works fine.  If the clothing is changed to a dark colour the border then blends in with the colour and looks terrible, the clothing just looks like a dark blob.&lt;br&gt;
&lt;br&gt;
The solution is to pick a contrasting, neutral colour for the border layer.  I&apos;ve tried to do this by converting the colour to HSV values then picking a colour where h=0, s=0, v=(255 - current v).  This should give a contrast but it results in mostly greys.  &lt;br&gt;
&lt;br&gt;
Is there a better way to programatically calculate a good, contrasting black/white shade for the border?  I have written a class that converts freely between HSV, RGB and Hex so I can work in any of those colour spaces.  I think HSV is the best one to work with but I&apos;m struggling with the logic of how to alter the S and V values to get a good contrast.</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.83559</guid>
  	<pubDate>Wed, 13 Feb 2008 10:50:57 -0800</pubDate>
  	<dc:creator>gaby</dc:creator>
	
	<category>colour</category>
	
	<category>theory</category>
	
	<category>hsv</category>
	
	<category>hsl</category>
	
	<category>as3</category>
	
</item>
<item>
  	<title>By: miniape</title>
  	<link>http://ask.metafilter.com/83559/Colour-Theory-and-HSV-Contrast#1237242</link>	
  	<description>Does the tip in the question here help you?&lt;br&gt;
&lt;a href=&quot;http://http://ask.metafilter.com/27289/color-me&quot;&gt;http://ask.metafilter.com/27289/color-me&lt;/a&gt;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.83559-1237242</guid>
  	<pubDate>Wed, 13 Feb 2008 12:03:53 -0800</pubDate>
  	<dc:creator>miniape</dc:creator>
</item>
<item>
  	<title>By: reebear</title>
  	<link>http://ask.metafilter.com/83559/Colour-Theory-and-HSV-Contrast#1237257</link>	
  	<description>The easy answer:&lt;br&gt;
&lt;br&gt;
For V = 0 - 80, border color = white&lt;br&gt;
For V = 80-255, border color = black&lt;br&gt;
&lt;br&gt;
If you wanted to tweak it up, you could throw in the same hue, decrease the saturation by a given percentage (say, -20%), and instead of going with straight black or straight white you could say,&lt;br&gt;
&lt;br&gt;
(strictly for V)&lt;br&gt;
&lt;br&gt;
For V = 0 - 80, border color = 175 + V&lt;br&gt;
For V = 80-255, border color = 255 - .5V (or .25V, etc.)&lt;br&gt;
&lt;br&gt;
You can play around with where you split the colors, but I&apos;d split it further towards the darker end of the spectrum.&lt;br&gt;
&lt;br&gt;
But if you really really wanted to throw color theory in there, you could try bringing the hue closer to purple/blue/a cooler color.&lt;br&gt;
&lt;br&gt;
Good luck. :)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.83559-1237257</guid>
  	<pubDate>Wed, 13 Feb 2008 12:20:36 -0800</pubDate>
  	<dc:creator>reebear</dc:creator>
</item>

    </channel>
</rss>
