GraphicsBuilder: extending paints - No Fluff Just Stuff

GraphicsBuilder: extending paints

Posted by: Andres Almiray on December 31, 2007

While looking at some SVG examples of gradient paints to be tested with Svg2Groovy I discovered that gradients may link to one another in order to reuse stop definitions, neat! which prompted a quick change into linearGradient and radialGradient to do the same, thanks to a new property named linkTo. But the goodies do not stop there, while linking you can add more stops to the new gradient or even override a previous stop at the same offset.




The image shows 5 vertical-oriented gradients, the first one serves as the basis for the next 3, the second gradient links to the first and adds a new stop at offset=0.33, the third one links to the second and adds a new stop at offset=0.66, the fourth one links to the third and overrides the stop at offset=0.66. The last gradient shows another new feature available in color(): the ability to decode hex color literals.

Happy Groovy New Year!
Andres Almiray

About Andres Almiray

Andres is a Java/Groovy developer and a Java Champion with more than 20 years of experience in software design and development. He has been involved in web and desktop application development since the early days of Java. Andres is a true believer in open source and has participated on popular projects like Groovy, Griffon, and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member of the Griffon framework and Hackergarten community event. https://ch.linkedin.com/in/aalmiray

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »