1. Computing

Add a Little Color to Your Shoes

By

4 of 4

Borders for Aesthetic Purposes
Add a Little Color to Your Shoes

Borders aren't just for keeping track of code and containers. They can also be used to create aesthetically pleasing patterns and separators. Carefully chosen border and background colors can create effects that enhance the overall look of your application.

Note here that the border method is called with both a color and a stroke width. The stroke width defines how wide the border is, in this case 5 pixels.

Shoes.app :width => 300, :height => 150 do
  background papayawhip

  stack :margin => 5 do
    background peru
    border peachpuff,
      :strokewidth => 5

    title "Title", :align => "center"
  end

  stack do
    para "This is a paragraph, it should ",
      "span multiple lines."
  end
end

Note that the border method is called with both a color and a stroke width. The stroke width defines how wide the border is, in this case 5 pixels.

  1. About.com
  2. Computing
  3. Ruby
  4. Graphical User Interfaces
  5. Shoes
  6. Borders for Aesthetic Purposes

©2014 About.com. All rights reserved.