Revision as of 18:43, 2 October 2008 by (Talk)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  Sugar Almanac


What colors are in the sugar system color palette?

To keep your activity with the same look and feel of the sugar os, you might want to consider using the system color palette in your activity. Here are some of the colors available to you to ensure a consistent look and feel.


How do I use the system colors in my activity?

The sugar color class has a number of conversion utilities returning these colors as different objects (e.g. gdk.Color, a hexadecimal string suitable for html, or an int value).

gdkWhite =
intWhite =

Is there a transparent color?

Yes there is. You want to use

Can I use the sugar color object for my own colors since it offers so many useful conversion functions?

Indeed, you can construct your own color objects with all of the same conversion utilities. Pass into the constructor a hexadecimal string. An optional second parameter lets you specify an alpha value.

red ='#FF0000')

How do I change the background color of my activity?

Here is how you would change the color of your activity's background using the sugar system colors:

#use an eventbox to set the background color, not a vbox (vbox doesnt have a gtk.gdk.window to draw background on) = gtk.EventBox()
self.set_canvas( ) gtk.STATE_NORMAL, )
#don't forget to show_all or you won't see your color changes! (or anything) )
Personal tools
  • Log in
  • Login with OpenID
About OLPC
About the laptop
About the tablet
OLPC wiki