A space-separated list of colors. You must specify each color using either the
ARGB format (#ff000000 = opaque black) or the RGB format (#000000 = black).
positions
A space-separated list of floats. The relative positions [0..1] of each
corresponding color in the colors attribute. If this is an empty string, the
colors are distributed evenly along the gradient line.
Optional attributes
The following attributes are optional:
direction
The direction of the sweep. Either CLOCKWISE or COUNTER_CLOCKWISE.
Defaults to CLOCKWISE.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-20 UTC."],[],[],null,["# SweepGradient\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nA gradient transitioning between two colors between a start and end angle.\n\nSyntax\n------\n\n```xml\n\u003cSweepGradient centerX=\"float\" centerY=\"float\"\n startAngle=\"float\" endAngle=\"float\"\n colors=\"argb-color argb-color\" positions=\"float float\" /\u003e\n```\n\nAttributes\n----------\n\nThe `SweepGradient` element has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`centerX`\n\n: The x-coordinate of the center of the radius.\n\n This attribute is [transformable](/training/wearables/wff/common/transform/transform).\n\n`centerY`\n\n: The y-coordinate of the center of the radius.\n\n This attribute is [transformable](/training/wearables/wff/common/transform/transform).\n\n`startAngle`\n\n: The angle (in degrees) to start the gradient.\n\n This attribute is [transformable](/training/wearables/wff/common/transform/transform).\n\n`endAngle`\n\n: The angle (in degrees) to end the gradient.\n\n This attribute is [transformable](/training/wearables/wff/common/transform/transform).\n\n`colors`\n\n: A space-separated list of colors. You must specify each color using either the\n ARGB format (`#ff000000` = opaque black) or the RGB format (`#000000` = black).\n\n`positions`\n\n: A space-separated list of floats. The relative positions \\[0..1\\] of each\n corresponding color in the colors attribute. If this is an empty string, the\n colors are distributed evenly along the gradient line.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`direction`\n: The direction of the sweep. Either `CLOCKWISE` or `COUNTER_CLOCKWISE`.\n Defaults to `CLOCKWISE`.\n\nInner elements\n--------------\n\nThe `SweepGradient` element can contain :\n\n- Between 0 and 4 [`Transform`](/training/wearables/wff/common/transform/transform) elements.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [TextCircular](/training/wearables/wff/group/part/text/text-circular)\n- [TextCircular](/training/wearables/wff/v2/group/part/text/text-circular)\n- [Arc](/training/wearables/wff/group/part/draw/shape/arc)"]]