<html>  
    <head>  
        <title>Astroblahhh.Com - JavaScript Simple Generator of a Single VUE Node with Three Random Colors</title>
<!

	Astroblahhh.Com JavaScript Simple Generator of a Single VUE Node with Three Random Colors

Except for parts not by Apollia:

    Copyright (C) 2013  Apollia

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/ .


    Contact info:     http://astroblahhh.com/contact-apollia.shtml 
!>
 
<script type="text/javascript" src="raphael-min.js"></script>

<script type="text/javascript">


// Apollia's note: I had nothing to do with authoring the wonderful Raphael library.
//
// Raphael's home page: 
// 		http://raphaeljs.com/
//
//
// Unlike my script, Raphael is licensed under the MIT license.
//
// 		http://raphaeljs.com/license.html 



/* 05:59 12/29/2013.  The "Astroblahhh.Com JavaScript Simple Generator of a Single VUE Node with Three Random Colors v1.0" is a rather sloppy update of an unreleased, small, originally less encapsulated unreleased script by the same name.

I didn't have the time or inclination to polish it up perfectly, since this works well enough, and I have more important things to do.

This script produces VUE 3.0.2 source code files, but fortunately, they can also be opened in VUE 3.2.2 (currently the most recent version of VUE - released May 23, 2013).


If you want to generate numerous VUE nodes with random colors and fonts, it would be far more convenient to use the "Astroblahhh.Com JavaScript Simple Generator of Many VUE Nodes with Random Colors and Fonts v1.0":

http://astroblahhh.com/software/javascript/astroblahhh-simple-generator-of-many-vue-nodes-with-random-colors-and-fonts-v1.0.html

*/




// ************************************
//
// Putting "window.[variable name]" is just a more explicit way 
// of declaring globals.  Inspired by: 
//			http://snook.ca/archives/javascript/global_variable



window.Astroblahhh_Single_VUE_Node_Generator=new Astroblahhh_Single_VUE_Node_Generator_Object();
	// An object to hold all stuff related to this script.
	
window.App=Astroblahhh_Single_VUE_Node_Generator;


function Astroblahhh_Single_VUE_Node_Generator_Object()
{	// Object constructor.

	var App=this;
	
	var stroke_width_to_use=3;
	
	
	this.Paper="";
	
	var random_fill_color;
	var random_stroke_color;
	var random_text_color;
	
	
	
	// From http://www.paulirish.com/2009/random-hex-color-code-snippets/
	
	var Random_Color = function()
	{		
		return '#'+ ('000000' + Math.floor(Math.random()*16777215).toString(16)).slice(-6);
	}
	
	// End of stuff from http://www.paulirish.com/2009/random-hex-color-code-snippets/



	var Make_Vue_File = function(random_fill_color, random_stroke_color, random_text_color)
	{ 
	 
		var string = "<!-- Tufts VUE 3.0.2 concept-map (zz-Randomly_Colored_Node.vue) 2013-11-28 --> \n\
<!-- Tufts VUE: http://vue.tufts.edu/ --> \n\
<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/C:/Program%20Files/VUE/VUE.jar!/tufts/vue/resources/lw_mapping_1_1.xml --> \n\
<!-- Do Not Remove: Saved date Thu Nov 28 05:41:55 EST 2013 by etc1 on platform Windows XP 5.1 in JVM 1.6.0_20-b02 --> \n\
<!-- Do Not Remove: Saving version @(#)VUE: built July 1 2010 at 1436 by vue on Linux 2.4.21-57.EL i386 JVM 1.5.0_06-b05(bits=32) --> \n\
<?xml version=\"1.0\" encoding=\"US-ASCII\"?> \n\
<LW-MAP xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n\
    xsi:noNamespaceSchemaLocation=\"none\" ID=\"0\" \n\
    label=\"zz-Randomly_Colored_Node.vue\" created=\"1286448484882\" x=\"0.0\" \n\
    y=\"0.0\" width=\"1.4E-45\" height=\"1.4E-45\" strokeWidth=\"0.0\" autoSized=\"false\"> \n\
    <resource referenceCreated=\"1385635315727\" size=\"7529\" \n\
        spec=\"E:\\Flower Meadow\\Vue Maps\\zz-Randomly_Colored_Node.vue\" \n\
        type=\"1\" xsi:type=\"URLResource\"> \n\
        <title>zz-Randomly_Colored_Node.vue</title> \n\
        <property key=\"File\" value=\"E:\\Flower Meadow\\Vue Maps\\zz-Randomly_Colored_Node.vue\"/> \n\
    </resource> \n\
    <fillColor>#000000</fillColor> \n\
    <strokeColor>#404040</strokeColor> \n\
    <textColor>#000000</textColor> \n\
    <font>SansSerif-plain-14</font> \n\
    <metadata-list category-list-size=\"1\" other-list-size=\"0\" \n\
        ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
        <ontology-list-string></ontology-list-string> \n\
        <metadata xsi:type=\"vue-metadata-element\"> \n\
            <value></value> \n\
            <key>http://vue.tufts.edu/vue.rdfs#none</key> \n\
            <type>1</type> \n\
        </metadata> \n\
    </metadata-list> \n\
    <URIString>http://vue.tufts.edu/rdf/resource/864e87aa7f00000101af1bd65edd32d6</URIString> \n\
    <child ID=\"6\" label=\"Test\" layerID=\"1\" created=\"1326289258796\" \n\
        x=\"177.0\" y=\"81.0\" width=\"182.0\" height=\"104.0\" \n\
        strokeWidth=\"";
        
        string += stroke_width_to_use;
        
        string += ".0\" autoSized=\"false\" xsi:type=\"node\"> \n\
        <fillColor>" + random_fill_color + "</fillColor> \n\
        <strokeColor>" + random_stroke_color + "</strokeColor> \n\
        <textColor>" + random_text_color + "</textColor> \n\
        <font>Verdana-plain-12</font> \n\
        <metadata-list category-list-size=\"1\" other-list-size=\"0\" \n\
            ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
            <ontology-list-string></ontology-list-string> \n\
            <metadata xsi:type=\"vue-metadata-element\"> \n\
                <value></value> \n\
                <key>http://vue.tufts.edu/vue.rdfs#none</key> \n\
                <type>1</type> \n\
            </metadata> \n\
        </metadata-list> \n\
        <URIString>http://vue.tufts.edu/rdf/resource/cd00423ec0a80165014fcf14e10b481d</URIString> \n\
        <shape xsi:type=\"ellipse\"/> \n\
    </child> \n\
    <layer ID=\"1\" label=\"Layer 1\" created=\"1286448484892\" x=\"0.0\" \n\
        y=\"0.0\" width=\"1.4E-45\" height=\"1.4E-45\" strokeWidth=\"0.0\" autoSized=\"false\"> \n\
        <metadata-list category-list-size=\"0\" other-list-size=\"0\" \n\
            ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
            <ontology-list-string></ontology-list-string> \n\
        </metadata-list> \n\
        <URIString>http://vue.tufts.edu/rdf/resource/864e87aa7f00000101af1bd6fc1562e0</URIString> \n\
    </layer> \n\
    <userZoom>1.0</userZoom> \n\
    <userOrigin x=\"-12.0\" y=\"-12.0\"/> \n\
    <presentationBackground>#202020</presentationBackground> \n\
    <PathwayList currentPathway=\"0\" revealerIndex=\"-1\"> \n\
        <pathway ID=\"0\" label=\"Untitled Pathway\" created=\"1286448484872\" \n\
            x=\"0.0\" y=\"0.0\" width=\"1.4E-45\" height=\"1.4E-45\" \n\
            strokeWidth=\"0.0\" autoSized=\"false\" currentIndex=\"0\" open=\"true\"> \n\
            <strokeColor>#B333CC33</strokeColor> \n\
            <textColor>#000000</textColor> \n\
            <font>SansSerif-plain-14</font> \n\
            <metadata-list category-list-size=\"0\" other-list-size=\"0\" \n\
                ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
                <ontology-list-string></ontology-list-string> \n\
            </metadata-list> \n\
            <URIString>http://vue.tufts.edu/rdf/resource/864e87b47f00000101af1bd628f6d416</URIString> \n\
            <masterSlide ID=\"2\" created=\"1286448485183\" x=\"0.0\" y=\"0.0\" \n\
                width=\"800.0\" height=\"600.0\" locked=\"true\" \n\
                strokeWidth=\"0.0\" autoSized=\"false\"> \n\
                <fillColor>#000000</fillColor> \n\
                <strokeColor>#404040</strokeColor> \n\
                <textColor>#000000</textColor> \n\
                <font>SansSerif-plain-14</font> \n\
                <metadata-list category-list-size=\"0\" \n\
                    other-list-size=\"0\" ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
                    <ontology-list-string></ontology-list-string> \n\
                </metadata-list> \n\
                <URIString>http://vue.tufts.edu/rdf/resource/864e87b47f00000101af1bd63ee1aa0a</URIString> \n\
                <titleStyle ID=\"3\" label=\"Header\" \n\
                    created=\"1286448485643\" x=\"335.5\" y=\"172.5\" \n\
                    width=\"129.0\" height=\"55.0\" strokeWidth=\"0.0\" \n\
                    autoSized=\"true\" isStyle=\"true\" xsi:type=\"node\"> \n\
                    <strokeColor>#404040</strokeColor> \n\
                    <textColor>#FFFFFF</textColor> \n\
                    <font>Gill Sans-plain-36</font> \n\
                    <metadata-list category-list-size=\"0\" \n\
                        other-list-size=\"0\" ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
                        <ontology-list-string></ontology-list-string> \n\
                    </metadata-list> \n\
                    <URIString>http://vue.tufts.edu/rdf/resource/864e87be7f00000101af1bd6ea661962</URIString> \n\
                    <shape xsi:type=\"rectangle\"/> \n\
                </titleStyle> \n\
                <textStyle ID=\"4\" label=\"Slide Text\" \n\
                    created=\"1286448485643\" x=\"346.5\" y=\"281.5\" \n\
                    width=\"107.0\" height=\"37.0\" strokeWidth=\"0.0\" \n\
                    autoSized=\"true\" isStyle=\"true\" xsi:type=\"node\"> \n\
                    <strokeColor>#404040</strokeColor> \n\
                    <textColor>#FFFFFF</textColor> \n\
                    <font>Gill Sans-plain-22</font> \n\
                    <metadata-list category-list-size=\"0\" \n\
                        other-list-size=\"0\" ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
                        <ontology-list-string></ontology-list-string> \n\
                    </metadata-list> \n\
                    <URIString>http://vue.tufts.edu/rdf/resource/864e87be7f00000101af1bd6d56c88f5</URIString> \n\
                    <shape xsi:type=\"rectangle\"/> \n\
                </textStyle> \n\
                <linkStyle ID=\"5\" label=\"Links\" created=\"1286448485653\" \n\
                    x=\"373.5\" y=\"384.0\" width=\"53.0\" height=\"32.0\" \n\
                    strokeWidth=\"0.0\" autoSized=\"true\" isStyle=\"true\" xsi:type=\"node\"> \n\
                    <strokeColor>#404040</strokeColor> \n\
                    <textColor>#B3BFE3</textColor> \n\
                    <font>Gill Sans-plain-18</font> \n\
                    <metadata-list category-list-size=\"0\" \n\
                        other-list-size=\"0\" ontology-list-size=\"0\" RCategoryListSize=\"0\"> \n\
                        <ontology-list-string></ontology-list-string> \n\
                    </metadata-list> \n\
                    <URIString>http://vue.tufts.edu/rdf/resource/864e87be7f00000101af1bd67317af47</URIString> \n\
                    <shape xsi:type=\"rectangle\"/> \n\
                </linkStyle> \n\
            </masterSlide> \n\
        </pathway> \n\
    </PathwayList> \n\
    <date>2010-10-07</date> \n\
    <mapFilterModel/> \n\
    <modelVersion>5</modelVersion> \n\
    <saveLocation>E:\\Flower Meadow\\Vue Maps</saveLocation> \n\
    <saveFile>E:\\Flower Meadow\\Vue Maps\\zz-Randomly_Colored_Node.vue</saveFile> \n\
</LW-MAP>";

	return string;

	}



	this.Do_Everything=function()
	{
		var window_width = window.innerWidth;
		var window_height = window.innerHeight;
		
		window_width = window_width-50;
		window_height = window_width/4;

		half_of_window_width=window_width/2;
		half_of_window_height=window_height/2;
	   
		ellipse_horizontal_radius=window_width/8;
	   
		ellipse_vertical_radius=ellipse_horizontal_radius/2;
	   
	   
		App.Paper = new Raphael(document.getElementById('canvas_container'), window_width, window_height); 
		
		
		var Circle = App.Paper.ellipse(half_of_window_width, half_of_window_height, ellipse_horizontal_radius, ellipse_vertical_radius);   
		
		
		random_fill_color=Random_Color();
		random_stroke_color=Random_Color();
		random_text_color=Random_Color();


		var Text = App.Paper.text(half_of_window_width, half_of_window_height, random_text_color);
		
		Text.attr( { stroke: random_text_color } );
		
		
		Circle.attr({fill: random_fill_color, stroke: random_stroke_color, "stroke-width": stroke_width_to_use } );
		
		
		Color_List_Text = "<table border><th>Fill (node interior)<th>Stroke (border)<th>Text";
				
		Color_List_Text += "<tr bgcolor='black'><td>";
	   
		Color_List_Text += "<font color='" + random_fill_color + "'>" + random_fill_color + "</font>";
		
		Color_List_Text += "<td><font color='" + random_stroke_color + "'>" + random_stroke_color + "</font>";

		Color_List_Text += "<td><font color='" + random_text_color + "'>" + random_text_color + "</font>";

		
		document.getElementById("colors_list").innerHTML = Color_List_Text;

		document.getElementById('more_button').focus();
		
		document.getElementById("vue_source_code").value = Make_Vue_File(random_fill_color, random_stroke_color, random_text_color);
	}
}


</script> 
        

<style type="text/css">
			
body
{
	background: black;
	color: CCC33A;
}
table, tr, td
{
	color: green;
	border: 1px solid;
}
input, textarea
{
	background: black;
	color: limegreen;
}
#canvas_container {  
	width: 100%;
	border: 1px solid #070;  
}  
</style>  

</head>  

<body onLoad="App.Do_Everything()">
<center>

<div id="canvas_container"></div>  
<div id="colors_list"></div>
<p>
<textarea id="vue_source_code" cols=50 rows=3 readonly>
</textarea>
<br>
<input type="button" id="more_button" onClick="App.Paper.remove();App.Do_Everything()" value="Make New Set of Colors">
<br>
Press Space, or Enter, or the button above to make a new set of colors.
<p>
<b>Warning:</b> There's no history nor undo!