1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Add a Little Color to Your Shoes

By

1 of 4

Color Names
Add a Little Color to Your Shoes

If you're looking to add a little color to your application, Shoes has a number of built-in color names that mirror the X11 Color Names used on Linux systems. The method names are all lowercase, and return the color to be used. That means, the X11 color DarkGoldenrod(for example) can be used by calling the darkgoldenrod method and other colors can called similiarly.

In addition to color names, you can also use HTML-style RGB hex values for creating arbitrary colors.

Shoes.app :width => 300, :height => 150 do
  background chocolate
  stack do
    title "Colors!",
      :stroke => darkred
    title "More colors!",
      :stroke => '#efb'
  end
end
  1. About.com
  2. Technology
  3. Ruby
  4. Graphical User Interfaces
  5. Shoes
  6. Add a Little Color to Your Shoes

©2014 About.com. All rights reserved.