<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problems with RGB and Color Index in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717848#M52233</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; I have to apologise to Alfred&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;No, you don't have to apologize for anything. I also don't see the logic behind the differences depending on background (well, I understand the inverting grey's, ok), it was just remembering to a thread long ago.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
    <pubDate>Fri, 30 Nov 2012 16:05:08 GMT</pubDate>
    <dc:creator>Alfred.NESWADBA</dc:creator>
    <dc:date>2012-11-30T16:05:08Z</dc:date>
    <item>
      <title>Problems with RGB and Color Index</title>
      <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3715706#M52228</link>
      <description>&lt;P&gt;AutoCAD 2013:&lt;/P&gt;&lt;P&gt;The RGB values for Colour 36 are 76,38,0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I do a color.fromRGB(76,38,0) the color i get back has colorIndex 38 (which according to the color picker in AutoCAD is 38,19,0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I being stupid or is this just wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2012 12:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3715706#M52228</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2012-11-29T12:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with RGB and Color Index</title>
      <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717422#M52229</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; The RGB values for Colour 36 are 76,38,0&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Where do you have that info from? Just to get not to complex in this discussion but try to use AutoCAD with black background and then with white background. If my brain works ok: Some years ago there was a discussion that RGB values (not just white and grey) changes with the color of the background.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you describe what your goal is, what you want to get done?&lt;/P&gt;&lt;P&gt;We may then have ideas on what to do or how to go on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 10:52:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717422#M52229</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-11-30T10:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with RGB and Color Index</title>
      <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717468#M52230</link>
      <description>&lt;P&gt;Hi Alfred,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The RGB values come from the colour picker in AutoCAD. When I hover the mouse over colour index 36 it displays the RGBs as 76,38,0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said, the colour I get back from Color.FromRGB(76,38,0) has a colour index of 38. I've tried it with a few other RGB values that I've taken from the colour picker. The RGBs for colour index&amp;nbsp;42 (165,124,0) give me a colour with index 44. The RGBs for colour index 44(127,95,0) give me a colour with index 46. It seemed to be giving me back a colour with the index of the next colour up on&amp;nbsp;the adjacent row in the colour picker grid. So, I thought I'd see what happened if I tried colour index 38 which is on the top row. The index I got back from the RGBs for 38 (38,19,0) is 28!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I have is that if I am identifying polylines for example, by their RGB values, and I use the colour index, I can't go from RGB to ColourIndex and back to the same&amp;nbsp;RGBs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's actually going:&lt;/P&gt;&lt;P&gt;Col1&amp;nbsp;= Color.FromRGB(76,38,0)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(Col1.ColourIndex&amp;nbsp;is then 38)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Polyline.Color = Col1&lt;/P&gt;&lt;P&gt;Col2&amp;nbsp;= Color.FromColorIndex(Polyline.ColorIndex)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Col2.R is then 38&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Col2.G is then 19&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Col2.B is then 0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason for trying to use the index was that our customer wanted to plot monochrome and setting a polyline colour to a colour that's been retrieved using RGB values, means that it still plots in colour even though it does have colour index within the 0-255 range. That's how I discovered the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working around it by using the colour indexes (indices?)&amp;nbsp;from the start so if I want a polyline that represents 'Area A' I set its colourIndex to 36 and then when I programmatically try to determine what the polyline is defining, I look again at its colour index which is 36 (obviously) which I then look up in my database to get back the value 'Area A'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry forgot to say, I've tried different background colours and it makes no difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 11:51:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717468#M52230</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2012-11-30T11:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with RGB and Color Index</title>
      <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717506#M52231</link>
      <description>&lt;PRE&gt;[CommandMethod("TestACI")]
public void TestACI() 
{
    Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
    Color Col1 = Color.FromRgb(76, 38, 0);
    byte index = EntityColor.LookUpAci(Col1.Red,Col1.Green, Col1.Blue);
    ed.WriteMessage("\nAci index = {0}", index);
    int rgb = EntityColor.LookUpRgb(index);
    System.Drawing.Color Col2 = System.Drawing.Color.FromArgb(rgb);
    ed.WriteMessage("\nColor Red={0}, Green={1}, Blue={2}", &lt;BR /&gt;                        Col2.R, Col2.G, Col2.B);
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Also this link can be useful: &lt;A href="https://forums.autodesk.com/t5/NET/Converting-colors/td-p/1957097" target="_blank"&gt;http://forums.autodesk.com/t5/NET/Converting-colors/td-p/1957097&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 13:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717506#M52231</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-11-30T13:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with RGB and Color Index</title>
      <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717744#M52232</link>
      <description>&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you might have misunderstood what I was trying to do but no matter. I didn't know about the EntityColor.LookupACI so thanks for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to apologise to Alfred. Changing the background colour does indeed affect the colour palette. I had my background colour set to 40,40,40 which is why when I changed it to white I didn't see any change.&lt;/P&gt;&lt;P&gt;It seems that 31,31,31 is the tipping point. Under that and the colour palette displays the correct RGBs against the indexes. Anything over that and the palette is shifted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure I really understand &lt;EM&gt;why&lt;/EM&gt; it shifts but at least I know now and I can code for it in future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 14:51:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717744#M52232</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2012-11-30T14:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with RGB and Color Index</title>
      <link>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717848#M52233</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; I have to apologise to Alfred&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;No, you don't have to apologize for anything. I also don't see the logic behind the differences depending on background (well, I understand the inverting grey's, ok), it was just remembering to a thread long ago.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 16:05:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problems-with-rgb-and-color-index/m-p/3717848#M52233</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-11-30T16:05:08Z</dc:date>
    </item>
  </channel>
</rss>

