Development Team/Almanac/sugar.graphics.style: Difference between revisions

No edit summary
 
(9 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Sugar Almanac}}
{{Almanac}}




=== What colors are in the sugar system color palette? ==
=== 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.
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.
*COLOR_PANEL_GREY
*COLOR_PANEL_GREY
Line 11: Line 11:
*COLOR_INACTIVE_STROKE
*COLOR_INACTIVE_STROKE
*COLOR_TEXT_FIELD_GREY
*COLOR_TEXT_FIELD_GREY


=== How do I use the system colors in my activity? ===
=== How do I use the system colors in my activity? ===
Line 19: Line 20:
intWhite = sugar.graphics.style.COLOR_WHITE.get_int()
intWhite = sugar.graphics.style.COLOR_WHITE.get_int()
</pre>
</pre>




=== Is there a transparent color? ===
=== Is there a transparent color? ===
Yes there is.  You want to use sugar.graphics.style.COLOR_TRANSPARENT
Yes there is.  You want to use sugar.graphics.style.COLOR_TRANSPARENT


=== Can I use the sugar color object for my own colors since it offers so many useful conversion functions?  ===
=== Can I use the sugar color object for my own colors since it offers so many useful conversion functions?  ===
Line 30: Line 34:
red = sugar.graphics.style.Color('#FF0000')
red = sugar.graphics.style.Color('#FF0000')
</pre>
</pre>