{
// (PDF 1.1) Set color space for stroking operations
COSName name = (COSName)arguments.get( 0 );
PDColorSpace cs = PDColorSpaceFactory.createColorSpace( name, context.getColorSpaces(),
context.getResources().getPatterns() );
PDColorState colorInstance = context.getGraphicsState().getNonStrokingColor();
colorInstance.setColorSpace( cs );
int numComponents = cs.getNumberOfComponents();
float[] values = EMPTY_FLOAT_ARRAY;
if( numComponents >= 0 )
{
values = new float[numComponents];
for( int i=0; i<numComponents; i++ )
{
values[i] = 0f;
}
if( cs instanceof PDDeviceCMYK )
{
values[3] = 1f;
}
}
colorInstance.setColorSpaceValue( values );
}