Class SVGColor

All Implemented Interfaces:
XMLConstants, ErrorConstants, SVGConverter, SVGSyntax, CSSConstants, SVGConstants

public class SVGColor extends AbstractSVGConverter
Utility class that converts a Color object into a set of corresponding SVG attributes.
See Also:
  • Field Details

    • aqua

      public static final Color aqua
      Predefined CSS colors
    • black

      public static final Color black
    • blue

      public static final Color blue
    • fuchsia

      public static final Color fuchsia
    • gray

      public static final Color gray
    • green

      public static final Color green
    • lime

      public static final Color lime
    • maroon

      public static final Color maroon
    • olive

      public static final Color olive
    • purple

      public static final Color purple
    • red

      public static final Color red
    • silver

      public static final Color silver
    • teal

      public static final Color teal
    • white

      public static final Color white
    • yellow

      public static final Color yellow
  • Constructor Details

    • SVGColor

      public SVGColor(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - used by converter to handle precision or to create elements.
  • Method Details

    • toSVG

      public SVGDescriptor toSVG(GraphicContext gc)
      Converts part or all of the input GraphicContext into a set of attribute/value pairs and related definitions
      Parameters:
      gc - GraphicContext to be converted
      Returns:
      descriptor of the attributes required to represent some or all of the GraphicContext state, along with the related definitions
      See Also:
    • toSVG

      public static SVGPaintDescriptor toSVG(Color color, SVGGeneratorContext gc)
      Converts a Color object to a set of two corresponding values: a CSS color string and an opacity value.