<?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/"
	>

<channel>
	<title>The ILNumerics Blog &#187; Dark</title>
	<atom:link href="https://ilnumerics.net/blog/tag/dark/feed/" rel="self" type="application/rss+xml" />
	<link>https://ilnumerics.net/blog</link>
	<description>The Productivity Machine  &#124;  A fresh attempt for scientific computing  &#124;  http://ilnumerics.net</description>
	<lastBuildDate>Thu, 05 Dec 2024 09:09:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Dark color schemes with ILPanel</title>
		<link>https://ilnumerics.net/blog/dark-color-schemes-with-ilpanel/</link>
		<comments>https://ilnumerics.net/blog/dark-color-schemes-with-ilpanel/#comments</comments>
		<pubDate>Fri, 18 Apr 2014 15:35:10 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Dark]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=580</guid>
		<description><![CDATA[<p>I recently got a request for help in building an application, where ILPanel was supposed to create some plots with a dark background area. Dark color schemes are very popular in some industrial domains and ILNumerics&#8217; ILPanel gives the full flexibility for supporting dark colors. Here comes a simple example: And here comes the code &#8230; <a href="https://ilnumerics.net/blog/dark-color-schemes-with-ilpanel/" class="more-link">Continue reading <span class="screen-reader-text">Dark color schemes with ILPanel</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/dark-color-schemes-with-ilpanel/">Dark color schemes with ILPanel</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I recently got a request for help in building an application, where ILPanel was supposed to create some plots with a dark background area. Dark color schemes are very popular in some industrial domains and ILNumerics&#8217; <code>ILPanel </code>gives the full flexibility for supporting dark colors. Here comes a simple example:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2014/04/TorusPartBlackBG1.png"><img class="aligncenter size-full wp-image-587" src="http://ilnumerics.net/blog/wp-content/uploads/2014/04/TorusPartBlackBG1.png" alt="" width="566" height="544" /></a><span id="more-580"></span></p>
<p>And here comes the code used to create this example:</p>
<pre class="brush: csharp; title: ; notranslate">
private void ilPanel1_Load(object sender, EventArgs e) {
    // create some test data
    ILArray&lt;float&gt; A = ILSpecialData.torus(1.3f, 0.6f);

    // create the plot: a simple surface
    ilPanel1.Scene.Add(new ILPlotCube(twoDMode: false) {
        new ILSurface(A, colormap: Colormaps.Summer) {
            // we also want a colorbar
            new ILColorbar() {
                Background = {
                    Color = Color.DarkGray
                }
            }
        }
    });

    // set the backcolor of the scene to black
    ilPanel1.BackColor = Color.Black; 

    // set labels color
    foreach (var label in ilPanel1.Scene.Find&lt;ILLabel&gt;()) {
        label.Color = Color.White;
        label.Fringe.Width = 0;
    }

    // set the color of the default labels for axis ticks
    foreach (var axis in ilPanel1.Scene.Find&lt;ILAxis&gt;()) {
        axis.Ticks.DefaultLabel.Color = Color.White;
        axis.Ticks.DefaultLabel.Fringe.Width = 0;
    }

    // some more configuration: the view limits
    ilPanel1.Scene.First&lt;ILPlotCube&gt;().Limits.Set(
        new Vector3(0, 0, 1), new Vector3(2, 2, -1));

}
</pre>
<p>In line 4 we use the <code>ILSpecialData </code>class to create some test data. <code>torus() </code>creates the X, Y and Z values which eventually assemble a torus when used in <code>ILSurface</code>. The next line creates and adds a new plot cube to the scene. We set its <code>two2Mode</code> property to <code>false</code>, so we can rotate the torus with the mouse.</p>
<p>The next line creates a new surface and provides the torus data to it. As colormap &#8216;Colormaps.Summer&#8217; is configured. Most surfaces need a colorbar in order to help mapping colors to actual values. We add a new colorbar below the surface and set its background color to some dark value.</p>
<p>Next, the BackColor of the main panel is set to black. Note, that setting the background color of a panel must be done in code in the current version (3.3.3). This is due to a bug in ILPanel which causes settings made in the designer to be ignored!</p>
<p>Now we have a dark background color but the labels still remain black. So let&#8217;s fix this: all labels which are part of the regular scene graph can easily be set at once. We simply use the <code>ILGroup.Find()</code> function to enumerate all labels and set their color to white. Also, we remove the fringe around them. Alternatively we could have set the fringe color to some dark color.</p>
<p>The last issue remaining is caused by the fact that labels for ticks cannot be configured here. The reason is, that tick labels are created dynamically. they don&#8217;t even exist at the time of execution of this code. So we must configure a thing called &#8216;<code>DefaultLabel</code>&#8216; instead. <code>DefaultLabel</code> is a member of the ticks collection of every axis object and used at runtime to provide default properties for all tick labels in auto mode.</p>
<p>This gives a nice dark color scheme. Keep in mind that the default color values for all scene-/plot objects are currently optimized for light background colors. Using dark backgrounds, therefore requires one to adjust the color on all plot objects accordingly.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/dark-color-schemes-with-ilpanel/">Dark color schemes with ILPanel</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/dark-color-schemes-with-ilpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
