From 0b9ae1db131705d4ddff38d1b866eaf5f3bb2b24 Mon Sep 17 00:00:00 2001 From: Eliot Jones Date: Sun, 4 Aug 2019 16:47:47 +0100 Subject: [PATCH] add color information to the operation context. create color classes for letters and paths to use --- .../Graphics/TestOperationContext.cs | 20 ++++-- .../PublicApiScannerTests.cs | 3 +- .../Graphics/Colors/CMYKColor.cs | 53 ++++++++++++++ .../Graphics/Colors/GrayColor.cs | 33 +++++++++ src/UglyToad.PdfPig/Graphics/Colors/IColor.cs | 18 +++++ .../Graphics/Colors/RGBColor.cs | 45 ++++++++++++ .../Graphics/ColorspaceContext.cs | 69 ++++++++++++++++++- .../Graphics/ContentStreamProcessor.cs | 2 +- .../Graphics/IColorspaceContext.cs | 25 ++++++- .../Graphics/IOperationContext.cs | 2 +- .../Graphics/Operations/SetNonStrokeColor.cs | 14 ++++ .../Operations/SetNonStrokeColorAdvanced.cs | 20 ++++++ .../Operations/SetNonStrokeColorDeviceCmyk.cs | 2 +- .../Operations/SetNonStrokeColorDeviceGray.cs | 2 +- .../Operations/SetNonStrokeColorDeviceRgb.cs | 2 +- .../Operations/SetNonStrokeColorSpace.cs | 2 +- .../Graphics/Operations/SetStrokeColor.cs | 6 +- .../Operations/SetStrokeColorAdvanced.cs | 22 +++++- .../Operations/SetStrokeColorDeviceCmyk.cs | 2 +- .../Operations/SetStrokeColorDeviceGray.cs | 2 +- .../Operations/SetStrokeColorDeviceRgb.cs | 2 +- .../Operations/SetStrokeColorSpace.cs | 2 +- 22 files changed, 323 insertions(+), 25 deletions(-) create mode 100644 src/UglyToad.PdfPig/Graphics/Colors/CMYKColor.cs create mode 100644 src/UglyToad.PdfPig/Graphics/Colors/GrayColor.cs create mode 100644 src/UglyToad.PdfPig/Graphics/Colors/IColor.cs create mode 100644 src/UglyToad.PdfPig/Graphics/Colors/RGBColor.cs diff --git a/src/UglyToad.PdfPig.Tests/Graphics/TestOperationContext.cs b/src/UglyToad.PdfPig.Tests/Graphics/TestOperationContext.cs index eec41f81..a88e530d 100644 --- a/src/UglyToad.PdfPig.Tests/Graphics/TestOperationContext.cs +++ b/src/UglyToad.PdfPig.Tests/Graphics/TestOperationContext.cs @@ -3,9 +3,10 @@ using System.Collections.Generic; using PdfPig.Geometry; using PdfPig.Graphics; + using PdfPig.Graphics.Colors; using PdfPig.IO; using PdfPig.Tokens; - using UglyToad.PdfPig.Core; + using PdfPig.Core; internal class TestOperationContext : IOperationContext { @@ -17,14 +18,11 @@ public TextMatrices TextMatrices { get; set; } = new TextMatrices(); - public TransformationMatrix CurrentTransformationMatrix - { - get { return GetCurrentState().CurrentTransformationMatrix; } - } + public TransformationMatrix CurrentTransformationMatrix => GetCurrentState().CurrentTransformationMatrix; public PdfPath CurrentPath { get; set; } - public IColorspaceContext ColorspaceContext { get; } = new ColorspaceContext(); + public IColorSpaceContext ColorSpaceContext { get; } = new ColorSpaceContext(); public PdfPoint CurrentPosition { get; set; } @@ -81,8 +79,16 @@ } } - public class TestColorspaceContext : IColorspaceContext + public class TestColorSpaceContext : IColorSpaceContext { + public ColorSpace CurrentStrokingColorSpace { get; } = ColorSpace.DeviceGray; + + public ColorSpace CurrentNonStrokingColorSpace { get; } = ColorSpace.DeviceGray; + + public IColor CurrentStrokingColor { get; } = GrayColor.Black; + + public IColor CurrentNonStrokingColor { get; } = GrayColor.Black; + public void SetStrokingColorspace(NameToken colorspace) { } diff --git a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs index 5f3e20a3..184dd905 100644 --- a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs +++ b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs @@ -80,6 +80,7 @@ "UglyToad.PdfPig.Graphics.Colors.ColorSpace", "UglyToad.PdfPig.Graphics.Colors.ColorSpaceExtensions", "UglyToad.PdfPig.Graphics.Colors.ColorSpaceFamily", + "UglyToad.PdfPig.Graphics.Colors.IColor", "UglyToad.PdfPig.Graphics.Core.LineCapStyle", "UglyToad.PdfPig.Graphics.Core.LineDashPattern", "UglyToad.PdfPig.Graphics.Core.LineJoinStyle", @@ -87,7 +88,7 @@ "UglyToad.PdfPig.Graphics.Core.TextRenderingMode", "UglyToad.PdfPig.Graphics.CurrentFontState", "UglyToad.PdfPig.Graphics.CurrentGraphicsState", - "UglyToad.PdfPig.Graphics.IColorspaceContext", + "UglyToad.PdfPig.Graphics.IColorSpaceContext", "UglyToad.PdfPig.Graphics.IOperationContext", "UglyToad.PdfPig.Graphics.Operations.ClippingPaths.ModifyClippingByEvenOddIntersect", "UglyToad.PdfPig.Graphics.Operations.ClippingPaths.ModifyClippingByNonZeroWindingIntersect", diff --git a/src/UglyToad.PdfPig/Graphics/Colors/CMYKColor.cs b/src/UglyToad.PdfPig/Graphics/Colors/CMYKColor.cs new file mode 100644 index 00000000..2f6f8369 --- /dev/null +++ b/src/UglyToad.PdfPig/Graphics/Colors/CMYKColor.cs @@ -0,0 +1,53 @@ +namespace UglyToad.PdfPig.Graphics.Colors +{ + /// + /// A color with cyan, magenta, yellow and black (K) components. + /// + internal class CMYKColor : IColor + { + public static IColor Black { get; } = new CMYKColor(0, 0, 0, 1); + public static IColor White { get; } = new CMYKColor(0, 0, 0, 0); + + /// + public ColorSpace ColorSpace { get; } = ColorSpace.DeviceCMYK; + + /// + /// The cyan value. + /// + public decimal C { get; } + + /// + /// The magenta value. + /// + public decimal M { get; } + + /// + /// The yellow value. + /// + public decimal Y { get; } + + /// + /// The black value. + /// + public decimal K { get; } + + /// + /// Create a new . + /// + public CMYKColor(decimal c, decimal m, decimal y, decimal k) + { + C = c; + M = m; + Y = y; + K = k; + } + + /// + public (decimal r, decimal g, decimal b) ToRGBValues() + { + return ((255 * (1 - C) * (1 - K)) / 255m, + (255 * (1 - M) * (1 - K)) / 255m, + (255 * (1 - Y) * (1 - K)) / 255m); + } + } +} \ No newline at end of file diff --git a/src/UglyToad.PdfPig/Graphics/Colors/GrayColor.cs b/src/UglyToad.PdfPig/Graphics/Colors/GrayColor.cs new file mode 100644 index 00000000..f375507f --- /dev/null +++ b/src/UglyToad.PdfPig/Graphics/Colors/GrayColor.cs @@ -0,0 +1,33 @@ +namespace UglyToad.PdfPig.Graphics.Colors +{ + /// + /// A grayscale color with a single gray component. + /// + internal class GrayColor : IColor + { + public static GrayColor Black { get; } = new GrayColor(0); + public static GrayColor White { get; } = new GrayColor(1); + + /// + public ColorSpace ColorSpace { get; } = ColorSpace.DeviceGray; + + /// + /// The gray value between 0 and 1. + /// + public decimal Gray { get; } + + /// + /// Create a new . + /// + public GrayColor(decimal gray) + { + Gray = gray; + } + + /// + public (decimal r, decimal g, decimal b) ToRGBValues() + { + return (Gray, Gray, Gray); + } + } +} \ No newline at end of file diff --git a/src/UglyToad.PdfPig/Graphics/Colors/IColor.cs b/src/UglyToad.PdfPig/Graphics/Colors/IColor.cs new file mode 100644 index 00000000..a3fcaf4f --- /dev/null +++ b/src/UglyToad.PdfPig/Graphics/Colors/IColor.cs @@ -0,0 +1,18 @@ +namespace UglyToad.PdfPig.Graphics.Colors +{ + /// + /// A color used for text or paths in a PDF. + /// + public interface IColor + { + /// + /// The colorspace used for this color. + /// + ColorSpace ColorSpace { get; } + + /// + /// The color as RGB values (between 0 and 1). + /// + (decimal r, decimal g, decimal b) ToRGBValues(); + } +} diff --git a/src/UglyToad.PdfPig/Graphics/Colors/RGBColor.cs b/src/UglyToad.PdfPig/Graphics/Colors/RGBColor.cs new file mode 100644 index 00000000..99bb407e --- /dev/null +++ b/src/UglyToad.PdfPig/Graphics/Colors/RGBColor.cs @@ -0,0 +1,45 @@ +namespace UglyToad.PdfPig.Graphics.Colors +{ + /// + /// A color with red, green and blue components. + /// + internal class RGBColor : IColor + { + public static RGBColor Black = new RGBColor(0, 0, 0); + public static RGBColor White = new RGBColor(1, 1, 1); + + /// + public ColorSpace ColorSpace { get; } = ColorSpace.DeviceRGB; + + /// + /// The red value. + /// + public decimal R { get; } + + /// + /// The green value. + /// + public decimal G { get; } + + /// + /// The blue value. + /// + public decimal B { get; } + + /// + /// Create a new . + /// + public RGBColor(decimal r, decimal g, decimal b) + { + R = r; + G = g; + B = b; + } + + /// + public (decimal r, decimal g, decimal b) ToRGBValues() + { + return (R, G, B); + } + } +} \ No newline at end of file diff --git a/src/UglyToad.PdfPig/Graphics/ColorspaceContext.cs b/src/UglyToad.PdfPig/Graphics/ColorspaceContext.cs index 3ef2a7bc..dd57c50f 100644 --- a/src/UglyToad.PdfPig/Graphics/ColorspaceContext.cs +++ b/src/UglyToad.PdfPig/Graphics/ColorspaceContext.cs @@ -1,39 +1,106 @@ namespace UglyToad.PdfPig.Graphics { + using Colors; using Tokens; - internal class ColorspaceContext : IColorspaceContext + internal class ColorSpaceContext : IColorSpaceContext { + public ColorSpace CurrentStrokingColorSpace { get; private set; } = ColorSpace.DeviceGray; + public ColorSpace CurrentNonStrokingColorSpace { get; private set; } = ColorSpace.DeviceGray; + + public IColor CurrentStrokingColor { get; private set; } = GrayColor.Black; + public IColor CurrentNonStrokingColor { get; private set; } = GrayColor.Black; + public void SetStrokingColorspace(NameToken colorspace) { + if (colorspace.TryMapToColorSpace(out var colorspaceActual)) + { + CurrentStrokingColorSpace = colorspaceActual; + switch (colorspaceActual) + { + case ColorSpace.DeviceGray: + CurrentStrokingColor = GrayColor.Black; + break; + case ColorSpace.DeviceRGB: + CurrentStrokingColor = RGBColor.Black; + break; + case ColorSpace.DeviceCMYK: + CurrentStrokingColor = CMYKColor.Black; + break; + default: + CurrentStrokingColor = GrayColor.Black; + break; + } + } + else + { + CurrentStrokingColorSpace = ColorSpace.DeviceGray; + CurrentStrokingColor = GrayColor.Black; + } } public void SetNonStrokingColorspace(NameToken colorspace) { + if (colorspace.TryMapToColorSpace(out var colorspaceActual)) + { + CurrentNonStrokingColorSpace = colorspaceActual; + switch (colorspaceActual) + { + case ColorSpace.DeviceGray: + CurrentNonStrokingColor = GrayColor.Black; + break; + case ColorSpace.DeviceRGB: + CurrentNonStrokingColor = RGBColor.Black; + break; + case ColorSpace.DeviceCMYK: + CurrentNonStrokingColor = CMYKColor.Black; + break; + default: + CurrentNonStrokingColor = GrayColor.Black; + break; + } + } + else + { + CurrentNonStrokingColorSpace = ColorSpace.DeviceGray; + CurrentNonStrokingColor = GrayColor.Black; + } } public void SetStrokingColorGray(decimal gray) { + CurrentStrokingColorSpace = ColorSpace.DeviceGray; + CurrentStrokingColor = new GrayColor(gray); } public void SetStrokingColorRgb(decimal r, decimal g, decimal b) { + CurrentStrokingColorSpace = ColorSpace.DeviceRGB; + CurrentStrokingColor = new RGBColor(r, g, b); } public void SetStrokingColorCmyk(decimal c, decimal m, decimal y, decimal k) { + CurrentStrokingColorSpace = ColorSpace.DeviceCMYK; + CurrentStrokingColor = new CMYKColor(c, m, y, k); } public void SetNonStrokingColorGray(decimal gray) { + CurrentNonStrokingColorSpace = ColorSpace.DeviceGray; + CurrentNonStrokingColor = new GrayColor(gray); } public void SetNonStrokingColorRgb(decimal r, decimal g, decimal b) { + CurrentNonStrokingColorSpace = ColorSpace.DeviceRGB; + CurrentNonStrokingColor = new RGBColor(r, g, b); } public void SetNonStrokingColorCmyk(decimal c, decimal m, decimal y, decimal k) { + CurrentNonStrokingColorSpace = ColorSpace.DeviceCMYK; + CurrentNonStrokingColor = new CMYKColor(c, m, y, k); } } } \ No newline at end of file diff --git a/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs b/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs index 6d4d9aa2..1ee653ca 100644 --- a/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs +++ b/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs @@ -39,7 +39,7 @@ public PdfPath CurrentPath { get; private set; } - public IColorspaceContext ColorspaceContext { get; } = new ColorspaceContext(); + public IColorSpaceContext ColorSpaceContext { get; } = new ColorSpaceContext(); public PdfPoint CurrentPosition { get; set; } diff --git a/src/UglyToad.PdfPig/Graphics/IColorspaceContext.cs b/src/UglyToad.PdfPig/Graphics/IColorspaceContext.cs index 8d336038..594b675e 100644 --- a/src/UglyToad.PdfPig/Graphics/IColorspaceContext.cs +++ b/src/UglyToad.PdfPig/Graphics/IColorspaceContext.cs @@ -1,12 +1,33 @@ namespace UglyToad.PdfPig.Graphics { + using Colors; using Tokens; /// /// Methods for manipulating and retrieving the current color state for a PDF content stream. /// - public interface IColorspaceContext + public interface IColorSpaceContext { + /// + /// The used for stroking operations. + /// + ColorSpace CurrentStrokingColorSpace { get; } + + /// + /// The used for non-stroking operations. + /// + ColorSpace CurrentNonStrokingColorSpace { get; } + + /// + /// The used for stroking operations. + /// + IColor CurrentStrokingColor { get; } + + /// + /// The used for non-stroking operations. + /// + IColor CurrentNonStrokingColor { get; } + /// /// Set the current color space to use for stroking operations. /// @@ -39,7 +60,7 @@ /// Yellow - A number between 0 (minimum concentration) and 1 (maximum concentration). /// Black - A number between 0 (minimum concentration) and 1 (maximum concentration). void SetStrokingColorCmyk(decimal c, decimal m, decimal y, decimal k); - + /// /// Set the nonstroking color space to DeviceGray and set the gray level to use for nonstroking operations. /// diff --git a/src/UglyToad.PdfPig/Graphics/IOperationContext.cs b/src/UglyToad.PdfPig/Graphics/IOperationContext.cs index eb6b6cfa..b77a415a 100644 --- a/src/UglyToad.PdfPig/Graphics/IOperationContext.cs +++ b/src/UglyToad.PdfPig/Graphics/IOperationContext.cs @@ -21,7 +21,7 @@ /// /// The active colorspaces for this content stream. /// - IColorspaceContext ColorspaceContext { get; } + IColorSpaceContext ColorSpaceContext { get; } /// /// The current position. diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColor.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColor.cs index 09789070..0be5d155 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColor.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColor.cs @@ -35,6 +35,20 @@ /// public void Run(IOperationContext operationContext) { + switch (Operands.Count) + { + case 1: + operationContext.ColorSpaceContext.SetNonStrokingColorGray(Operands[0]); + break; + case 3: + operationContext.ColorSpaceContext.SetNonStrokingColorRgb(Operands[0], Operands[1], Operands[2]); + break; + case 4: + operationContext.ColorSpaceContext.SetNonStrokingColorCmyk(Operands[0], Operands[1], Operands[2], Operands[3]); + break; + default: + return; + } } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorAdvanced.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorAdvanced.cs index ccc43157..07bc465e 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorAdvanced.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorAdvanced.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; + using Colors; using Tokens; using Writer; @@ -53,6 +54,25 @@ /// public void Run(IOperationContext operationContext) { + if (operationContext.ColorSpaceContext.CurrentNonStrokingColorSpace.GetFamily() != ColorSpaceFamily.Device) + { + return; + } + + switch (Operands.Count) + { + case 1: + operationContext.ColorSpaceContext.SetNonStrokingColorGray(Operands[0]); + break; + case 3: + operationContext.ColorSpaceContext.SetNonStrokingColorRgb(Operands[0], Operands[1], Operands[2]); + break; + case 4: + operationContext.ColorSpaceContext.SetNonStrokingColorCmyk(Operands[0], Operands[1], Operands[2], Operands[3]); + break; + default: + return; + } } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceCmyk.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceCmyk.cs index 8d0ae3be..cc813718 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceCmyk.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceCmyk.cs @@ -54,7 +54,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetNonStrokingColorCmyk(C, M, Y, K); + operationContext.ColorSpaceContext.SetNonStrokingColorCmyk(C, M, Y, K); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceGray.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceGray.cs index 3c256ceb..6267efb8 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceGray.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceGray.cs @@ -33,7 +33,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetNonStrokingColorGray(Gray); + operationContext.ColorSpaceContext.SetNonStrokingColorGray(Gray); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceRgb.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceRgb.cs index cc063792..71f45b82 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceRgb.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorDeviceRgb.cs @@ -47,7 +47,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetNonStrokingColorRgb(R, G, B); + operationContext.ColorSpaceContext.SetNonStrokingColorRgb(R, G, B); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorSpace.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorSpace.cs index b057637b..7715e82d 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorSpace.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetNonStrokeColorSpace.cs @@ -36,7 +36,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetNonStrokingColorspace(Name); + operationContext.ColorSpaceContext.SetNonStrokingColorspace(Name); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColor.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColor.cs index 9e7b0fbb..5061de31 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColor.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColor.cs @@ -38,13 +38,13 @@ switch (Operands.Count) { case 1: - operationContext.ColorspaceContext.SetStrokingColorGray(Operands[0]); + operationContext.ColorSpaceContext.SetStrokingColorGray(Operands[0]); break; case 3: - operationContext.ColorspaceContext.SetStrokingColorRgb(Operands[0], Operands[1], Operands[2]); + operationContext.ColorSpaceContext.SetStrokingColorRgb(Operands[0], Operands[1], Operands[2]); break; case 4: - operationContext.ColorspaceContext.SetStrokingColorCmyk(Operands[0], Operands[1], Operands[2], Operands[3]); + operationContext.ColorSpaceContext.SetStrokingColorCmyk(Operands[0], Operands[1], Operands[2], Operands[3]); break; default: return; diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorAdvanced.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorAdvanced.cs index 60a90ab3..3bd5dcf9 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorAdvanced.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorAdvanced.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; + using Colors; using Tokens; using Writer; @@ -40,7 +41,7 @@ } /// - /// Create a new . + /// Create a new . /// /// The color operands. /// The pattern name. @@ -53,6 +54,25 @@ /// public void Run(IOperationContext operationContext) { + if (operationContext.ColorSpaceContext.CurrentStrokingColorSpace.GetFamily() != ColorSpaceFamily.Device) + { + return; + } + + switch (Operands.Count) + { + case 1: + operationContext.ColorSpaceContext.SetStrokingColorGray(Operands[0]); + break; + case 3: + operationContext.ColorSpaceContext.SetStrokingColorRgb(Operands[0], Operands[1], Operands[2]); + break; + case 4: + operationContext.ColorSpaceContext.SetStrokingColorCmyk(Operands[0], Operands[1], Operands[2], Operands[3]); + break; + default: + return; + } } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceCmyk.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceCmyk.cs index f5ce5880..8976c946 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceCmyk.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceCmyk.cs @@ -54,7 +54,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetStrokingColorCmyk(C, M, Y, K); + operationContext.ColorSpaceContext.SetStrokingColorCmyk(C, M, Y, K); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceGray.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceGray.cs index 397cab25..c5dc26c7 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceGray.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceGray.cs @@ -33,7 +33,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetStrokingColorGray(Gray); + operationContext.ColorSpaceContext.SetStrokingColorGray(Gray); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceRgb.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceRgb.cs index fe9bd5f0..d1e5bb40 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceRgb.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorDeviceRgb.cs @@ -47,7 +47,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetStrokingColorRgb(R, G, B); + operationContext.ColorSpaceContext.SetStrokingColorRgb(R, G, B); } /// diff --git a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorSpace.cs b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorSpace.cs index a0369ecc..8c03e731 100644 --- a/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorSpace.cs +++ b/src/UglyToad.PdfPig/Graphics/Operations/SetStrokeColorSpace.cs @@ -36,7 +36,7 @@ /// public void Run(IOperationContext operationContext) { - operationContext.ColorspaceContext.SetStrokingColorspace(Name); + operationContext.ColorSpaceContext.SetStrokingColorspace(Name); } ///