code: public static Rule createSimpleLineRule( Color color, float width ) {
          LineSymbolizer lineSymbolizer = StyleUtilities.sf.createLineSymbolizer();
          lineSymbolizer.setStroke(StyleUtilities.sf.createStroke(
                  StyleUtilities.ff.literal("#" + Integer.toHexString(color.getRGB() & 0xffffff)), StyleUtilities.ff.literal(width)));
  
          Rule rule = StyleUtilities.sf.createRule();
          rule.setName("New rule");
          rule.symbolizers().add(lineSymbolizer);
  
          return rule;
      }
docs: Creates a simple {@link Rule} for a line.
  
  @param color
  the color.
  @param width
  the line width.
  @return the rule.