public void setNonStrokingColor ( final PDColor color ) throws IOException { if ( nonStrokingColorSpaceStack . isEmpty ( ) || nonStrokingColorSpaceStack . peek ( ) != color . getColorSpace ( ) ) { writeOperand ( getName ( color . getColorSpace ( ) ) ) ; writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; if ( nonStrokingColorSpaceStack . isEmpty ( ) ) { nonStrokingColorSpaceStack . add ( color . getColorSpace ( ) ) ; } else { nonStrokingColorSpaceStack . set ( nonStrokingColorSpaceStack . size ( ) - 1 , color . getColorSpace ( ) ) ; } } for ( final float value : color . getComponents ( ) ) { writeOperand ( value ) ; } if ( color . getColorSpace ( ) instanceof PDPattern ) { writeOperand ( color . getPatternName ( ) ) ; } if ( color . getColorSpace ( ) instanceof PDPattern || color . getColorSpace ( ) instanceof PDSeparation || color . getColorSpace ( ) instanceof PDDeviceN || color . getColorSpace ( ) instanceof PDICCBased ) { writeOperator ( ( byte ) ' ' , ( byte ) ' ' , ( byte ) ' ' ) ; } else { writeOperator ( ( byte ) ' ' , ( byte ) ' ' ) ; } }
Sets the non - stroking color and if necessary the non - stroking color space .