예제 #1
0
        private Color GetColor(IList colorArgs)
        {
            Color color = null;

            switch (colorArgs.Count)
            {
            case 1: {
                color = new DeviceGray(((PdfNumber)colorArgs[0]).FloatValue());
                break;
            }

            case 3: {
                color = new DeviceRgb(((PdfNumber)colorArgs[0]).FloatValue(), ((PdfNumber)colorArgs[1]).FloatValue(), ((PdfNumber
                                                                                                                        )colorArgs[2]).FloatValue());
                break;
            }

            case 4: {
                color = new DeviceCmyk(((PdfNumber)colorArgs[0]).FloatValue(), ((PdfNumber)colorArgs[1]).FloatValue(), ((PdfNumber
                                                                                                                         )colorArgs[2]).FloatValue(), ((PdfNumber)colorArgs[3]).FloatValue());
                break;
            }
            }
            return(color);
        }
예제 #2
0
 protected internal virtual Color GetDarkerColor()
 {
     if (color is DeviceRgb)
     {
         return(DeviceRgb.MakeDarker((DeviceRgb)color));
     }
     else
     {
         if (color is DeviceCmyk)
         {
             return(DeviceCmyk.MakeDarker((DeviceCmyk)color));
         }
         else
         {
             if (color is DeviceGray)
             {
                 return(DeviceGray.MakeDarker((DeviceGray)color));
             }
         }
     }
     return(color);
 }
예제 #3
0
        /// <summary>
        /// Makes the
        /// <see cref="Border.transparentColor"/>
        /// color of the border darker and returns the result
        /// </summary>
        /// <returns>The darker color</returns>
        protected internal virtual Color GetDarkerColor()
        {
            Color color = this.transparentColor.GetColor();

            if (color is DeviceRgb)
            {
                return(DeviceRgb.MakeDarker((DeviceRgb)color));
            }
            else
            {
                if (color is DeviceCmyk)
                {
                    return(DeviceCmyk.MakeDarker((DeviceCmyk)color));
                }
                else
                {
                    if (color is DeviceGray)
                    {
                        return(DeviceGray.MakeDarker((DeviceGray)color));
                    }
                }
            }
            return(color);
        }
예제 #4
0
 /// <summary>Creates a Border3D instance with the specified width and color.</summary>
 /// <param name="color">color of the border</param>
 /// <param name="width">with of the border</param>
 protected internal Border3D(DeviceGray color, float width)
     : base(color, width)
 {
 }
예제 #5
0
 /// <summary>
 /// Creates an InsetBorder instance with the specified width and the
 /// <see cref="iText.Kernel.Colors.DeviceGray">gray color</see>.
 /// </summary>
 /// <param name="width">width of the border</param>
 /// <param name="color">
 /// the
 /// <see cref="iText.Kernel.Colors.DeviceGray">gray color</see>
 /// of the border
 /// </param>
 public InsetBorder(DeviceGray color, float width)
     : base(color, width)
 {
 }
예제 #6
0
 /// <summary>Creates an InsetBorder instance with the specified width, color and opacity.</summary>
 /// <param name="color">color of the border</param>
 /// <param name="width">width of the border</param>
 /// <param name="opacity">opacity of the border</param>
 public InsetBorder(DeviceGray color, float width, float opacity)
     : base(color, width, opacity)
 {
 }
 public virtual iText.Kernel.Pdf.Annot.DA.AnnotationDefaultAppearance SetColor(DeviceGray grayColor)
 {
     SetColorOperand(grayColor.GetColorValue(), "g");
     return(this);
 }
예제 #8
0
 /// <summary>
 /// Creates a RidgeBorder instance with the specified width and the
 /// <see cref="iText.Kernel.Colors.DeviceGray">gray color</see>
 /// .
 /// </summary>
 /// <param name="width">width of the border</param>
 /// <param name="color">
 /// the
 /// <see cref="iText.Kernel.Colors.DeviceGray">gray color</see>
 /// of the border
 /// </param>
 public RidgeBorder(DeviceGray color, float width)
     : base(color, width)
 {
 }
예제 #9
0
 /// <summary>Creates a GrooveBorder instance with the specified width, color and opacity.</summary>
 /// <param name="color">color of the border</param>
 /// <param name="width">width of the border</param>
 /// <param name="opacity">opacity of the border</param>
 public GrooveBorder(DeviceGray color, float width, float opacity)
     : base(color, width, opacity)
 {
 }
예제 #10
0
 /// <summary>
 /// Creates a GrooveBorder instance with the specified width and the
 /// <see cref="iText.Kernel.Colors.DeviceGray">gray color</see>
 /// .
 /// </summary>
 /// <param name="width">width of the border</param>
 /// <param name="color">
 /// the
 /// <see cref="iText.Kernel.Colors.DeviceGray">gray color</see>
 /// of the border
 /// </param>
 public GrooveBorder(DeviceGray color, float width)
     : base(color, width)
 {
 }
예제 #11
0
 /// <summary>Creates a Border3D instance with the specified width, color and opacity.</summary>
 /// <param name="color">color of the border</param>
 /// <param name="width">width of the border</param>
 /// <param name="opacity">opacity of the border</param>
 protected internal Border3D(DeviceGray color, float width, float opacity)
     : base(color, width, opacity)
 {
 }