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.
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.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["# RadialGradient\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nA gradient transitioning between two colors radiating from a central origin\npoint.\n\nSyntax\n------\n\n```xml\n\u003cRadialGradient centerX=\"float\" centerY=\"float\" radius=\"float\"\n colors=\"argb-color argb-color\" positions=\"float float\" /\u003e\n```\n\nAttributes\n----------\n\nThe `RadialGradient` element must contain the following attributes:\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`radius`\n\n: Must be positive. The radius for the circle for this 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\nInner elements\n--------------\n\nThe `RadialGradient` 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- [SweepGradient](/training/wearables/wff/group/part/draw/gradient/sweep-gradient)\n- [LinearGradient](/training/wearables/wff/group/part/draw/gradient/linear-gradient)\n- [Stroke](/training/wearables/wff/group/part/draw/style/stroke)"]]