<?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>Linea de Codigo &#187; SVG</title>
	<atom:link href="http://lineadecodigo.com/categoria/svg/feed/" rel="self" type="application/rss+xml" />
	<link>http://lineadecodigo.com</link>
	<description>/* Programación en la red */</description>
	<lastBuildDate>Wed, 16 May 2012 06:00:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Dibujar un rectángulo con SVG</title>
		<link>http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/</link>
		<comments>http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 22:54:03 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[rect]]></category>
		<category><![CDATA[rectangulo]]></category>
		<category><![CDATA[STYLE]]></category>
		<category><![CDATA[width]]></category>
		<category><![CDATA[x]]></category>
		<category><![CDATA[y]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=1609</guid>
		<description><![CDATA[Dibujar un rectángulo con SVG es una cosa bastante fácil ya que el rectangulo es una de las figuras estándar del lenguaje SVG. Para ello necesitaremos utilizar la etiqueta RECT Los dos primeros atributos importantes para nuestro ejemplo son la altura y ancho del rectangulo. Para ello utilizaremos los atributos de la etiqueta RECT: width [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1609'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fdibujar-un-rectangulo-con-svg%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/" data-count="horizontal" data-text="Dibujar un rectángulo con SVG" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Dibujar un rectángulo con <a href="http://www.manualweb.net/tutorial-svg/" title="SVG">SVG</a> es una cosa bastante fácil ya que el rectangulo es una de las figuras estándar del lenguaje <a href="http://www.manualweb.net/tutorial-svg/" title="SVG">SVG</a>. Para ello necesitaremos utilizar la etiqueta <a href="http://www.w3api.com/wiki/SVG:Rect" title="rect">RECT</a></p>
<p>Los dos primeros atributos importantes para nuestro ejemplo son la altura y ancho del rectangulo. Para ello utilizaremos los atributos de la etiqueta <a href="http://www.w3api.com/wiki/SVG:Rect" title="rect">RECT</a>: <a href="http://www.w3api.com/wiki/SVG:Width" title="width">width</a> y <a href="http://www.w3api.com/wiki/SVG:Height" title="height">height</a>.</p>
<pre class="svg" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&lt;rect width=&quot;200&quot; height=&quot;100&quot; fill=&quot;red&quot;/&gt;</div></li></ol></pre>
<p>Otra cosa que podemos hacer es la de posicionar el rectangulo dentro del lienzo. Para ello tendremos que definir las coordenadas X,Y del lienzo. El nombre de los atributos es el mismo: <a href="http://www.w3api.com/wiki/SVG:X" title="X">X</a> e <a href="http://www.w3api.com/wiki/SVG:Y" title="Y">Y</a>.</p>
<pre class="svg" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&lt;rect x=&quot;50&quot; y=&quot;50&quot; width=&quot;200&quot; height=&quot;100&quot;&quot;/&gt;</div></li></ol></pre>
<p>Por último vamos a darle color a la cosa. En este caso, utilizaremos el atributo <a href="http://www.w3api.com/wiki/SVG:Fill" title="fill">fill</a>, indicándole el color que queremos usar (rojo en este caso):</p>
<pre class="svg" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&lt;rect fill=&quot;red&quot;&gt;</div></li></ol></pre>
<p>Aunque podríamos darle el color mediante un estilo y el atributo <a href="http://www.w3api.com/wiki/SVG:Style" title="style">style</a>:</p>
<pre class="svg" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&lt;rect style=&quot;fill:red;&quot;/&gt;</div></li></ol></pre>
<p>El código que nos quedaría al final sería algo parecido a lo siguiente:</p>
<pre class="svg" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&lt;rect x=&quot;50&quot; y=&quot;50&quot; width=&quot;200&quot; height=&quot;100&quot; fill=&quot;red&quot;/&gt;</div></li></ol></pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/rectangulo-redondeado-en-svg/" rel="bookmark" title="Diciembre 24, 2007">Rectángulo redondeado en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/" rel="bookmark" title="Diciembre 30, 2007">Dibujar una línea en SVG</a></li>
<li><a href="http://lineadecodigo.com/css/definir-el-tamano-de-una-imagen-con-css/" rel="bookmark" title="Diciembre 9, 2007">Definir el tamaño de una imagen con CSS</a></li>
<li><a href="http://lineadecodigo.com/svg/transparencia-y-opacidad-en-svg/" rel="bookmark" title="Enero 15, 2008">Transparencia y Opacidad en SVG</a></li>
<li><a href="http://lineadecodigo.com/java/area-de-un-rectangulo-con-java/" rel="bookmark" title="Diciembre 13, 2007">Area de un rectángulo con Java</a></li>
</ul>
<p><!-- Similar Posts took 6.391 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1609()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1609(){ jQuery(document).ready(function($) { $('.dd-google1-1609').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Borde con gradiente lineal</title>
		<link>http://lineadecodigo.com/svg/borde-con-gradiente-lineal/</link>
		<comments>http://lineadecodigo.com/svg/borde-con-gradiente-lineal/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 09:00:00 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[circle]]></category>
		<category><![CDATA[defs]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[gradiente]]></category>
		<category><![CDATA[lineal]]></category>
		<category><![CDATA[linearGradient]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[stop-color]]></category>
		<category><![CDATA[storke-width]]></category>
		<category><![CDATA[stroke]]></category>
		<category><![CDATA[STYLE]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/02/07/borde-con-gradiente-lineal/</guid>
		<description><![CDATA[Lo más normal es utilizar un gradiente como relleno de una figura. Eso no quiere decir que no podamos utilizar el gradiente sobre un borde. Para poder realizar esta operación lo primero que tenemos que hacer es definir nuestro gradiente. La forma de hacer esto es la misma indistintamente de donde vayamos a utilizar este. [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1162'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/borde-con-gradiente-lineal/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fborde-con-gradiente-lineal%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/borde-con-gradiente-lineal/" data-count="horizontal" data-text="Borde con gradiente lineal" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Lo más normal es utilizar un gradiente como relleno de una figura. Eso no quiere decir que no podamos utilizar el gradiente sobre un borde.</p>
<p>Para poder realizar esta operación lo primero que tenemos que hacer es definir nuestro gradiente. La forma de hacer esto es la misma indistintamente de donde vayamos a utilizar este. A si que tendremos una definición de gradiente como la que sigue:</p>
<p><span id="more-1162"></span>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;defs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;rojo_naranja&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;30%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#f00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#ff0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/defs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li></ol></pre>
<p>Si ves muy complicado el definir el gradiente, en <a href="http://lineadecodigo.com" title="Linea de Codigo">Linea de Código</a> tienes muchos artículos y <a href="http://lineadecodigo.com/tag/gradiente" title="ejemplos que te explican como trabajar con gradientes">ejemplos que te explican como trabajar con gradientes</a>.</p>
<p>Ahora solo nos queda utilizar el gradiente como fondo del borde. Recordar que el relleno de los bordes de las figuras básicas o shapes se suele controlar con el atributo stroke.</p>
<p>Y para hacer referencia al gradiente hay que utilizar la función url. Esta recibirá como parámetro el nombre que le hayamos dado al ID del gradiente, precedido de una almohadilla (#). El código a utilizar sería este:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">url(#rojo_naranja)</div></li></ol></pre>
<p>Al final tendremos el siguiente código. En este caso, aplicado a un círculo (no es que tenga nada contra el resto de figuras básicas):</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;defs<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;circle</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #000066;">r</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fill:#fff&quot;</span> <span style="color: #000066;">stroke</span>=<span style="color: #ff0000;">&quot;url(#rojo_naranja)&quot;</span> <span style="color: #000066;">stroke-width</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/02/gradiente-como-borde.svg' title='Borde con gradiente lineal'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/02/gradiente-como-borde.zip' title='Descargar Borde con gradiente lineal'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/" rel="bookmark" title="Enero 17, 2008">Circulo con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/svg/gradiente-lineal-vertical/" rel="bookmark" title="Enero 28, 2008">Gradiente lineal vertical</a></li>
<li><a href="http://lineadecodigo.com/css/borde-con-doble-linea-mediante-css/" rel="bookmark" title="Julio 12, 2007">Borde con doble linea mediante CSS</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/" rel="bookmark" title="Enero 13, 2008">Dibujando un polígono: triángulo</a></li>
<li><a href="http://lineadecodigo.com/css/borde-con-lineas-discontinuas/" rel="bookmark" title="Julio 9, 2007">Borde con lineas discontinuas</a></li>
</ul>
<p><!-- Similar Posts took 4.637 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1162()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1162(){ jQuery(document).ready(function($) { $('.dd-google1-1162').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/borde-con-gradiente-lineal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gradiente linear angular en SVG</title>
		<link>http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/</link>
		<comments>http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 09:00:55 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[gradiente]]></category>
		<category><![CDATA[linearGradient]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/02/05/gradiente-linear-angular-en-svg/</guid>
		<description><![CDATA[Dos buenos ejemplos para empezar aprendiendo de gradientes en SVG son Circulo con Gradiente Lineal y Gradiente Lineal Vertical. Los cuales explican como hacer gradientes lineales horizontales y verticales respectivamente. A si que lo que nos queda por explicar es como hacer un gradiente lineal angular en SVG Cuando decimos angular, lo que queremos decir [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1156'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fgradiente-linear-angular-en-svg%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/" data-count="horizontal" data-text="Gradiente linear angular en SVG" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Dos buenos ejemplos para empezar aprendiendo de gradientes en SVG son <a href="http://lineadecodigo.com/2008/01/17/circulo-con-gradiente-lineal/" title="Circulo con Gradiente Lineal">Circulo con Gradiente Lineal</a> y <a href="http://lineadecodigo.com/2008/01/28/gradiente-lineal-vertical/" title="Gradiente Lineal Vertical">Gradiente Lineal Vertical</a>. Los cuales explican como hacer gradientes lineales horizontales y verticales respectivamente. A si que lo que nos queda por explicar es como hacer un gradiente lineal angular en SVG</p>
<p><span id="more-1156"></span>Cuando decimos angular, lo que queremos decir es que el vector que representa la transición de los colores tiene un cierto ángulo. Dentro de la definición del gradiente lineal, la cual hacemos mediante la etiqueta &lt;linearGradient&gt;, no encontramos forma de definir el angulo del vector. Para poder llevar a cabo esto, solo tenemos las coordenadas de inicio y de fin del vector.</p>
<p>Y la forma de conseguir un angulo es que tanto las coordenadas x1 y x2, como las coordenadas y1 e y2 sean diferentes entre si.</p>
<p>Así, por ejemplo, un angulo de 90 grados (noroeste) lo podríamos conseguir con la siguiente secuencia de coordenadas:</p>
<pre>x1=0 y1=100 x2=100 y2=0</pre>
<p>Quedándonos el siguiente código:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;gradiente_angular&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;20%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#f00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;80%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#ff0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/02/gradiente-lineal-angular.svg' title='Gradiente linear angular en SVG'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/02/gradiente-lineal-angular.zip' title='Descargar Gradiente linear angular en SVG'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/gradiente-lineal-vertical/" rel="bookmark" title="Enero 28, 2008">Gradiente lineal vertical</a></li>
<li><a href="http://lineadecodigo.com/svg/borde-con-gradiente-lineal/" rel="bookmark" title="Febrero 7, 2008">Borde con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/" rel="bookmark" title="Enero 17, 2008">Circulo con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/java/insertar-un-elemento-en-una-posicion-concreta-del-vector/" rel="bookmark" title="Enero 19, 2009">Insertar un elemento en una posición concreta del Vector</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/" rel="bookmark" title="Diciembre 30, 2007">Dibujar una línea en SVG</a></li>
</ul>
<p><!-- Similar Posts took 5.127 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1156()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1156(){ jQuery(document).ready(function($) { $('.dd-google1-1156').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gradiente lineal vertical</title>
		<link>http://lineadecodigo.com/svg/gradiente-lineal-vertical/</link>
		<comments>http://lineadecodigo.com/svg/gradiente-lineal-vertical/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 14:00:30 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[gradiente]]></category>
		<category><![CDATA[lineal]]></category>
		<category><![CDATA[linearGradient]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[stop-color]]></category>
		<category><![CDATA[vertical]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/01/28/gradiente-lineal-vertical/</guid>
		<description><![CDATA[Un gradiente lineal es una transición de colores a lo largo de un vector. Normalmente de dos colores, aunque puede ser de tantos como queramos. Cuando dibujamos gradientes lineales, estos, pueden ser de tres formas: Horizontales Verticales Angulares La etiqueta SVG que nos sirve para definir gradientes es linearGradient. La cual, mediante coordenadas x1,y1 y [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1149'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/gradiente-lineal-vertical/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fgradiente-lineal-vertical%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/gradiente-lineal-vertical/" data-count="horizontal" data-text="Gradiente lineal vertical" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/gradientelinealvertical.jpg' title='Gradiente Lineal Vertical'><img src='http://img.aulambra.com/wp-content/uploads/2008/01/gradientelinealvertical.thumbnail.jpg' alt='Gradiente Lineal Vertical' align="right"/></a></p>
<p>Un gradiente lineal es una transición de colores a lo largo de un vector. Normalmente de dos colores, aunque puede ser de tantos como queramos.</p>
<p>Cuando dibujamos gradientes lineales, estos, pueden ser de tres formas:</p>
<ul>
<li>Horizontales</li>
<li>Verticales</li>
<li>Angulares</li>
</ul>
<p><span id="more-1149"></span>La etiqueta SVG que nos sirve para definir gradientes es linearGradient. La cual, mediante coordenadas x1,y1 y x2,y2 identifica el inicio y el fin del vector que coordina el gradiente.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;gradiente_vertical&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;valor&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;valor&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;valor&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;valor&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>En el caso que nos consta, gradiente lineal vertical, el "truco" está en el manejo de las coordenadas del gradiente. Mediante estas coordenadas lo que definimos es donde va a iniciar y donde va a terminar el gradiente.</p>
<p>A si que lo que tenemos que hacer es que las coordenadas x1 y x2 deben de ser iguales, mientras que las coordenadas y1 e y2 deben de ser diferentes.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;gradiente_vertical&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>Además a la etiqueta linearGradient le podemos anidar la etiqueta stop. Esta etiqueta nos ayuda a definir con que color iniciamos y con cual acabamos el gradiente. Para ello utiliza un atributo offset de posicionamiento de inicio del color y otro atributo denominado stop-color para indicar el color que se utiliza.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;20%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#f00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;80%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#ff0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>En este código indicaríamos que al 20% del vector se empieza a utilizar el color rojo (#f00) y que al 80% del vector pasamos al color amarillo (#ff0).</p>
<p>Veamos como quedaría todo el código de nuestro gradiente lineal vertical:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;gradiente_vertical&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;20%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#f00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;80%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#ff0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/gradiente-lineal-vertical.svg' title='Gradiente Lineal Vertical'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/01/gradiente-lineal-vertical.zip' title='Descargar Gradiente Lineal Vertical'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/" rel="bookmark" title="Febrero 5, 2008">Gradiente linear angular en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/" rel="bookmark" title="Enero 17, 2008">Circulo con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/svg/borde-con-gradiente-lineal/" rel="bookmark" title="Febrero 7, 2008">Borde con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/" rel="bookmark" title="Enero 13, 2008">Dibujando un polígono: triángulo</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/" rel="bookmark" title="Diciembre 30, 2007">Dibujar una línea en SVG</a></li>
</ul>
<p><!-- Similar Posts took 5.313 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1149()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1149(){ jQuery(document).ready(function($) { $('.dd-google1-1149').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/gradiente-lineal-vertical/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Circulo con gradiente lineal</title>
		<link>http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/</link>
		<comments>http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 07:00:54 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[circle]]></category>
		<category><![CDATA[defs]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[gradiente]]></category>
		<category><![CDATA[lineal]]></category>
		<category><![CDATA[linearGradient]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[stop-color]]></category>
		<category><![CDATA[stroke-width]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/01/17/circulo-con-gradiente-lineal/</guid>
		<description><![CDATA[Un gradiente lineal es una variación de color entre dos puntos de forma linear. Aunque, estoy seguro que la palabra gradiente tendrá múltiples interpretaciones dependiendo del área donde lo apliquemos, aquí vamos a ver como lo trata el lenguaje SVG. Pongámonos manos a la obra. El ejemplo intenta mostrar como hacer un gradiente linear que [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1122'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fcirculo-con-gradiente-lineal%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/" data-count="horizontal" data-text="Circulo con gradiente lineal" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Un gradiente lineal es una variación de color entre dos puntos de forma linear. Aunque, estoy seguro que la palabra gradiente tendrá múltiples interpretaciones dependiendo del área donde lo apliquemos, aquí vamos a ver como lo trata el lenguaje <a href="http://lineadecodigo.com/categoria/SVG/">SVG</a>.</p>
<p>Pongámonos manos a la obra. El ejemplo intenta mostrar como hacer un gradiente linear que pase del rojo al naranja dentro de un circulo.</p>
<p>Lo primero de todo y la clave de nuestro ejemplo será definir el gradiente que vamos a utilizar. Ya que posteriormente, dicho gradiente, lo aplicaremos sobre el circulo.</p>
<p><span id="more-1122"></span>Para definir el gradiente lineal utilizamos la etiqueta linearGradient. Entre los atributos de esta etiqueta encontramos el vector que define el gradiente linear. Dichos atributos son x1, y1, x2, y2. Este vector indica los puntos de inicio y fin donde el gradiente empezará y acabará. Los valores que podemos aplicar a dichos atributos pueden ser o bien número o bien porcentajes.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;rojo_naranja&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>Como etiquetas hijo dentro de linearGradient encontraremos el control de los colores mediante la etiqueta stop. Dicha etiqueta nos permitirá el definir el color con el que iniciamos y acabamos el gradiente.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;rojo_naranja&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#f00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#ff0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>La etiqueta stop tiene dos atributos significativos. El primero es offset, el cual indica, en que tanto por ciento del vector vamos a empezar a aplicar el gradiente. El segundo es stop-color, el cual indica el color a utilizar.</p>
<p>Toda esta declaración del gradiente, con el fin de poder ser utilizada, deberá de definirse dentro de las etiquetas de definición defs.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;defs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linearGradient</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;rojo_naranja&quot;</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;0%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;20%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#f00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stop</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;80%&quot;</span> <span style="color: #000066;">stop-color</span>=<span style="color: #ff0000;">&quot;#ff0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/defs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></li></ol></pre>
<p>Una vez completo nuestro gradiente linear. Solo quedará definir la figura a utilizar y sobre la cual aplicaremos el gradiente. En nuestro ejemplo será un circulo. Para aplicar el gradiente utilizamos el ID que le hayamos dado al mismo. En este caso "rojo_naranja". El ID será utilizado como relleno mediante la propiedad fill.</p>
<p>El código del circulo nos quedaría algo así:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;circle</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #000066;">r</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fill:url(#rojo_naranja)&quot;</span> <span style="color: #000066;">stroke</span>=<span style="color: #ff0000;">&quot;#000&quot;</span> <span style="color: #000066;">stroke-width</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/circulo-con-gradiente-lineal.svg' title='Circulo con gradiente lineal'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/01/circulo-con-gradiente-lineal.zip' title='Descargar Circulo con gradiente lineal'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/gradiente-lineal-vertical/" rel="bookmark" title="Enero 28, 2008">Gradiente lineal vertical</a></li>
<li><a href="http://lineadecodigo.com/svg/gradiente-linear-angular-en-svg/" rel="bookmark" title="Febrero 5, 2008">Gradiente linear angular en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-un-circulo-en-svg/" rel="bookmark" title="Diciembre 26, 2007">Dibujar un círculo en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/circulos-con-borde-en-svg/" rel="bookmark" title="Diciembre 28, 2007">Círculos con borde en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/borde-con-gradiente-lineal/" rel="bookmark" title="Febrero 7, 2008">Borde con gradiente lineal</a></li>
</ul>
<p><!-- Similar Posts took 5.293 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1122()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1122(){ jQuery(document).ready(function($) { $('.dd-google1-1122').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Transparencia y Opacidad en SVG</title>
		<link>http://lineadecodigo.com/svg/transparencia-y-opacidad-en-svg/</link>
		<comments>http://lineadecodigo.com/svg/transparencia-y-opacidad-en-svg/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 07:00:44 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[circle]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[LINE]]></category>
		<category><![CDATA[opacity]]></category>
		<category><![CDATA[transparencia]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/01/15/transparencia-y-opacidad-en-svg/</guid>
		<description><![CDATA[El objetivo de este ejemplo es ver cómo podemos definir objetos que sean transparentes en SVG. Para ello crearemos tres círculos y una línea que los atraviese.Dichos círculos irán aumentando su nivel de transparencia. Es decir, el primero será el más opaco y el último circulo será el más transparente. Lo primero es recordar cómo [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1119'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/transparencia-y-opacidad-en-svg/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Ftransparencia-y-opacidad-en-svg%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/transparencia-y-opacidad-en-svg/" data-count="horizontal" data-text="Transparencia y Opacidad en SVG" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>El objetivo de este ejemplo es ver cómo podemos definir objetos que sean transparentes en <a href="http://lineadecodigo.com/categoria/SVG/" title="SVG">SVG</a>. Para ello crearemos tres círculos y una línea que los atraviese.Dichos círculos irán aumentando su nivel de transparencia. Es decir, el primero será el más opaco y el último circulo será el más transparente.</p>
<p>Lo primero es recordar cómo se define un circulo. Para ello, es recomendable la lectura del ejemplo <a href="http://lineadecodigo.com/2007/12/26/dibujar-un-circulo-en-svg/" title="Dibujar un circulo en SVG">Dibujar un Circulo en SVG</a>. Pero, básicamente, consiste en utilizar la etiqueta &lt;CIRCLE/&gt; con más o menos atributos.</p>
<p><span id="more-1119"></span>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CIRCLE</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">r</span>=<span style="color: #ff0000;">&quot;50&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p>Para definir la transparencia del circulo utilizaremos el atributo <strong>opacity</strong> dentro de los estilos. Dicho atributo podrá tomar los valores de 0 a 1. Los decimales los utilizaremos con el separador de punto decimal. Por ejemplo 0.4. El valor de 1 hace que el elemento sea totalmente opaco, mientras que el valor de 0 hace que el elemento sea totalmente transparente.</p>
<p>Nos quedaría un código parecido a este:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CIRCLE</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;opacity:0.5;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p>Si ponemos 3 circulos, incrementando el valor de la opacidad, y desplazando su centro dentro del lienzos sería:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;circle</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">r</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fill:green;opacity:0.8&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;circle</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">r</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fill:green;opacity:0.5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;circle</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">r</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fill:green;opacity:0.2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p>Lo siguiente será poner una línea atravesando a los círculos. Para ello deberemos de utilizar la etiqueta &lt;LINE/&gt; con sus atributos de coordenadas x1,y1 x2,y2.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LINE</span> <span style="color: #000066;">x1</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">y1</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">x2</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">y2</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p>Y se me olvidaba otra cosa. El orden del pintado lo establece el orden en el que aparezca el código. A si que si queremos poner la línea debajo de los círculos, habrá que escribirla primero.</p>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/transparencia-opacidad.svg' title='Transparencia y Opacidad en SVG'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/01/transparencia-opacidad.zip' title='Descargar Transparencia y Opacidad en SVG'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/" rel="bookmark" title="Marzo 2, 2009">Dibujar un rectángulo con SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/" rel="bookmark" title="Enero 17, 2008">Circulo con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-un-circulo-en-svg/" rel="bookmark" title="Diciembre 26, 2007">Dibujar un círculo en SVG</a></li>
<li><a href="http://lineadecodigo.com/html/enlace-a-una-parte-concreta-de-la-pagina/" rel="bookmark" title="Enero 21, 2007">Enlace a una parte concreta de la página</a></li>
<li><a href="http://lineadecodigo.com/css/alineando-texto-al-centro/" rel="bookmark" title="Marzo 30, 2007">Alineando texto al centro</a></li>
</ul>
<p><!-- Similar Posts took 5.547 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1119()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1119(){ jQuery(document).ready(function($) { $('.dd-google1-1119').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/transparencia-y-opacidad-en-svg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dibujando un polígono: triángulo</title>
		<link>http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/</link>
		<comments>http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 07:00:32 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[points]]></category>
		<category><![CDATA[polígono]]></category>
		<category><![CDATA[POLYGON]]></category>
		<category><![CDATA[stroke]]></category>
		<category><![CDATA[stroke-width]]></category>
		<category><![CDATA[triangulo]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/01/13/dibujando-un-poligono-triangulo/</guid>
		<description><![CDATA[En este ejemplo vamos a ver los pasos necesarios para poder pintar un Triángulo en SVG utilizando el elemento POLYGON. Para ello lo único que necesitamos conocer los vértices de nuestro polígono. El polígono elegido es un Triángulo. Como su nombre bien dice, tendremos tres lados y consecuentemente tres vértices que tendremos que indicar al [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1116'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fdibujando-un-poligono-triangulo%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/" data-count="horizontal" data-text="Dibujando un polígono: triángulo" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>En este ejemplo vamos a ver los pasos necesarios para poder pintar un Triángulo en <a href="http://lineadecodigo.com/categoria/svg/" title="SVG">SVG</a> utilizando el elemento POLYGON. Para ello lo único que necesitamos conocer los vértices de nuestro polígono.</p>
<p>El polígono elegido es un Triángulo. Como su nombre bien dice, tendremos tres lados y consecuentemente tres vértices que tendremos que indicar al elemento POLYGON para que este se pueda pintar.</p>
<p>Los vértices de nuestro polígono son indicados mediante el atributo points. Para ello bastará dar las coordenadas de los puntos. Estas separadas entre comas y a su vez, cada coordenada, separada por un espacio.</p>
<p><span id="more-1116"></span>Las coordenadas elegidas para nuestro Triángulo son: (100,100) (100,200) y (200,200). La etiqueta nos quedará de la siguiente forma:</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;polygon</span> <span style="color: #000066;">points</span>=<span style="color: #ff0000;">&quot;100,100 100,200 200,200&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>En cuanto al coloreado del polígono tendremos que recurrir al atributo fill. Mediante el cual, y utilizando un nombre, indicaremos el color de relleno del Triángulo</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;polygon</span> <span style="color: #000066;">points</span>=<span style="color: #ff0000;">&quot;100,100 100,200 200,200&quot;</span> <span style="color: #000066;">fill</span>=<span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>Otra de las cosas que podemos modificar es el borde del Triángulo Para poder llevar a cabo esto utilizamos los atributos stroke para indicar el color del borde y stroke-width para indicar su tamaño.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;polygon</span> <span style="color: #000066;">stroke-width</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">stroke</span>=<span style="color: #ff0000;">&quot;green&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/dibujar-un-poligono-triangulo.svg' title='Dibujando un polígono: triángulo'><br />
Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/01/dibujar-un-poligono-triangulo.zip' title='Descargar Dibujando un polígono: triángulo'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/css/imagenes-con-borde/" rel="bookmark" title="Junio 4, 2007">Imagenes con borde</a></li>
<li><a href="http://lineadecodigo.com/svg/gradiente-lineal-vertical/" rel="bookmark" title="Enero 28, 2008">Gradiente lineal vertical</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-multiples-lineas-en-svg/" rel="bookmark" title="Diciembre 23, 2006">Dibujando multiples lineas en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/" rel="bookmark" title="Marzo 2, 2009">Dibujar un rectángulo con SVG</a></li>
<li><a href="http://lineadecodigo.com/css/bordes-3d-con-css/" rel="bookmark" title="Julio 18, 2007">Bordes 3D con CSS</a></li>
</ul>
<p><!-- Similar Posts took 5.168 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1116()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1116(){ jQuery(document).ready(function($) { $('.dd-google1-1116').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dibujar una elipse en SVG</title>
		<link>http://lineadecodigo.com/svg/dibujar-una-elipse-en-svg/</link>
		<comments>http://lineadecodigo.com/svg/dibujar-una-elipse-en-svg/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 17:30:00 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[ellipse]]></category>
		<category><![CDATA[fill]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/01/11/dibujar-una-elipse-en-svg/</guid>
		<description><![CDATA[Si queremos dibujar una elipse en SVG deberemos de utilizar la etiqueta &#60;ELLIPSE/&#62;. En este caso lo que vamos a hacer es dibujar una elipse de 50x100 de color rojo. La forma de configurarla es muy sencilla. En primer lugar lo que hay que hacer es posicionarla en el eje de coordenadas mediante los atributos [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1113'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/dibujar-una-elipse-en-svg/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fdibujar-una-elipse-en-svg%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/dibujar-una-elipse-en-svg/" data-count="horizontal" data-text="Dibujar una elipse en SVG" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Si queremos dibujar una elipse en SVG deberemos de utilizar la etiqueta &lt;ELLIPSE/&gt;. En este caso lo que vamos a hacer es dibujar una elipse de 50x100 de color rojo.</p>
<p>La forma de configurarla es muy sencilla. En primer lugar lo que hay que hacer es posicionarla en el eje de coordenadas mediante los atributos cx y cy.</p>
<p><span id="more-1113"></span>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ELLIPSE</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p>Una vez posicionada deberemos de darle un valor de radio de ancho y alto. En este caso utilizaremos los atributos rx y ry. Mediante rx especificamos el radio horizontal de la elipse y mediante ry el radio vertical.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ELLIPSE</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">rx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">ry</span>=<span style="color: #ff0000;">&quot;50&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p>Lo último que nos quedará será el rellenar la elipse del color elegido. Rojo en nuestro caso. Para ello utilizamos la propiedad de pintado fill dandole el nombre en ingles del color.</p>
<pre class="xml" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ELLIPSE</span> <span style="color: #000066;">cx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">cy</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">rx</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">ry</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">fill</span>=<span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/dibujar-una-elipse.svg' title='Dibujar una elipse'><br />
Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/01/dibujar-una-elipse.zip' title='Descargar Dibujar una elipse'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/" rel="bookmark" title="Diciembre 30, 2007">Dibujar una línea en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/" rel="bookmark" title="Enero 13, 2008">Dibujando un polígono: triángulo</a></li>
<li><a href="http://lineadecodigo.com/svg/circulo-con-gradiente-lineal/" rel="bookmark" title="Enero 17, 2008">Circulo con gradiente lineal</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-un-rectangulo-con-svg/" rel="bookmark" title="Marzo 2, 2009">Dibujar un rectángulo con SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/circulos-con-borde-en-svg/" rel="bookmark" title="Diciembre 28, 2007">Círculos con borde en SVG</a></li>
</ul>
<p><!-- Similar Posts took 5.074 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1113()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1113(){ jQuery(document).ready(function($) { $('.dd-google1-1113').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/dibujar-una-elipse-en-svg/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dibujar una línea en SVG</title>
		<link>http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/</link>
		<comments>http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 07:00:06 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[LINE]]></category>
		<category><![CDATA[storke]]></category>
		<category><![CDATA[stroke-width]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2007/12/30/dibujar-una-linea-en-svg/</guid>
		<description><![CDATA[Este es uno de los ejemplos más sencillos de SVG. Consiste en dibujar una línea dentro de un lienzo. Es para ello que explicaremos cómo poner una línea de color rojo que vaya de las coordenadas (10,10) a las (100,100). Para poderlo llevar a cabo tendremos que utilizar la etiqueta &#60;LINE/&#62;. La cual no tiene [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1075'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fdibujar-una-linea-en-svg%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/" data-count="horizontal" data-text="Dibujar una línea en SVG" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Este es uno de los ejemplos más sencillos de SVG. Consiste en dibujar una línea dentro de un lienzo. Es para ello que explicaremos cómo poner una línea de color rojo que vaya de las coordenadas (10,10) a las (100,100).</p>
<p><span id="more-1075"></span>Para poderlo llevar a cabo tendremos que utilizar la etiqueta &lt;LINE/&gt;. La cual no tiene mucho misterio ya que sus atributos representas las coordenadas x1,y1 e x2,y2 origen y destino de la línea. Quedándonos el siguiente código:</p>
<pre>&lt;LINE x1="10" y1="10" x2="100" y2="100"/&gt;</pre>
<p>Una última cosa que haremos será el dotar a la línea de un ancho mayor. En este caso utilizamos el atributo stroke-width y stroke para indicarle su color (el rojo).</p>
<pre>&lt;LINE stroke-width="5" stroke="red"/&gt;</pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2007/12/dibujar-una-linea.svg' title='Dibujar una línea en SVG'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2007/12/dibujar-una-linea.zip' title='Descargar Dibujar una línea en SVG'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/circulos-con-borde-en-svg/" rel="bookmark" title="Diciembre 28, 2007">Círculos con borde en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-multiples-lineas-en-svg/" rel="bookmark" title="Diciembre 23, 2006">Dibujando multiples lineas en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/" rel="bookmark" title="Enero 13, 2008">Dibujando un polígono: triángulo</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-una-elipse-en-svg/" rel="bookmark" title="Enero 11, 2008">Dibujar una elipse en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/gradiente-lineal-vertical/" rel="bookmark" title="Enero 28, 2008">Gradiente lineal vertical</a></li>
</ul>
<p><!-- Similar Posts took 8.394 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1075()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1075(){ jQuery(document).ready(function($) { $('.dd-google1-1075').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Círculos con borde en SVG</title>
		<link>http://lineadecodigo.com/svg/circulos-con-borde-en-svg/</link>
		<comments>http://lineadecodigo.com/svg/circulos-con-borde-en-svg/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 07:00:24 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[borde]]></category>
		<category><![CDATA[circulo]]></category>
		<category><![CDATA[stroke]]></category>
		<category><![CDATA[stroke-width]]></category>
		<category><![CDATA[STYLE]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2007/12/28/circulos-con-borde-en-svg/</guid>
		<description><![CDATA[Lo primero que tendremos que hacer será dibujar un circulo. Para ello utilizamos la etiqueta &#60;CIRCLE/&#62;. Es bastante interesante que le eches un vistazo al ejemplo Dibujar un círculo en SVG para poder acometer la tarea. Una vez tengamos nuestro circulo, simplemente tendremos que "abusar" de dos atributos: stroke: indica el color del borde. stroke-width: [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1072'></div><g:plusone size='medium' href='http://lineadecodigo.com/svg/circulos-con-borde-en-svg/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fsvg%2Fcirculos-con-borde-en-svg%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/svg/circulos-con-borde-en-svg/" data-count="horizontal" data-text="Círculos con borde en SVG" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Lo primero que tendremos que hacer será dibujar un circulo. Para ello utilizamos la etiqueta &lt;CIRCLE/&gt;. Es bastante interesante que le eches un vistazo al ejemplo <a href="http://lineadecodigo.com/2007/12/26/dibujar-un-circulo-en-svg/" title="Dibujar un círculo en SVG">Dibujar un círculo en SVG</a> para poder acometer la tarea.</p>
<p><span id="more-1072"></span>Una vez tengamos nuestro circulo, simplemente tendremos que "abusar" de dos atributos:</p>
<ul>
<li><strong>stroke:</strong> indica el color del borde.</li>
<li><strong>stroke-width:</strong> indica el ancho del borde.</li>
</ul>
<p>Al final tendremos el siguiente código:</p>
<pre>&lt;circle cx="100" cy="100" r="50" stroke="blue"
   stroke-width="10" style="fill:cyan;"/&gt;</pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2007/12/circulo-con-borde.svg' title='Circulo SVG con borde'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2007/12/circulo-con-borde.zip' title='Descargar Circulo SVG con borde'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/svg/dibujar-una-linea-en-svg/" rel="bookmark" title="Diciembre 30, 2007">Dibujar una línea en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujar-un-circulo-en-svg/" rel="bookmark" title="Diciembre 26, 2007">Dibujar un círculo en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-multiples-lineas-en-svg/" rel="bookmark" title="Diciembre 23, 2006">Dibujando multiples lineas en SVG</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-un-poligono-triangulo/" rel="bookmark" title="Enero 13, 2008">Dibujando un polígono: triángulo</a></li>
<li><a href="http://lineadecodigo.com/css/imagenes-con-borde/" rel="bookmark" title="Junio 4, 2007">Imagenes con borde</a></li>
</ul>
<p><!-- Similar Posts took 5.432 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1072()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1072(){ jQuery(document).ready(function($) { $('.dd-google1-1072').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/svg/circulos-con-borde-en-svg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: lineadecodigo.com @ 2012-05-17 20:05:21 by W3 Total Cache -->
