Class RGBColorDeclarationFormattingContext

java.lang.Object
io.sf.carte.doc.style.css.om.DefaultDeclarationFormattingContext
io.sf.carte.doc.style.css.om.RGBColorDeclarationFormattingContext
All Implemented Interfaces:
DeclarationFormattingContext, Serializable

public class RGBColorDeclarationFormattingContext extends DefaultDeclarationFormattingContext
DeclarationFormattingContext that serializes colors as RGB (sRGB).
See Also:
  • Constructor Details

    • RGBColorDeclarationFormattingContext

      public RGBColorDeclarationFormattingContext()
  • Method Details

    • writeValue

      public void writeValue(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSValue value) throws IOException
      Description copied from interface: DeclarationFormattingContext
      Write a css value to the given writer.

      The default implementation calls CSSValue.writeCssText(SimpleWriter).

      Parameters:
      wri - the writer.
      propertyName - the name of the property whose value is being printed.
      value - the value to write.
      Throws:
      IOException - if an error happened while writing.
    • writeMinifiedValue

      public void writeMinifiedValue(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSValue value) throws IOException
      Description copied from interface: DeclarationFormattingContext
      Write a minified css value to the given writer.

      Note that in order to guarantee some consistency, shorthands may not use this method to minify values.

      The default implementation just writes CSSValue.getMinifiedCssText(String).

      Parameters:
      wri - the writer.
      propertyName - the name of the property whose value is being printed.
      value - the value to write.
      Throws:
      IOException - if an error happened while writing.