internal static IColorComponents Load(ColorBookReader reader) { ComponentLab lab = new ComponentLab(); lab.L = (byte)(reader.ReadByte() / 2.55d + 0.5d); lab.a = (sbyte)(reader.ReadByte() - 128); lab.b = (sbyte)(reader.ReadByte() - 128); return lab; }
internal static IColorComponents Load(ColorBookReader reader) { ComponentRGB rgb = new ComponentRGB(); rgb.Red = reader.ReadByte(); rgb.Green = reader.ReadByte(); rgb.Blue = reader.ReadByte(); return rgb; }
internal static IColorComponents Load(ColorBookReader reader) { ComponentCMYK cmyk = new ComponentCMYK(); cmyk.Cyan = (byte)((255d - reader.ReadByte()) / 2.55d + 0.5d); cmyk.Magenta = (byte)((255d - reader.ReadByte()) / 2.55d + 0.5d); cmyk.Yellow = (byte)((255d - reader.ReadByte()) / 2.55d + 0.5d); cmyk.Key = (byte)((255d - reader.ReadByte()) / 2.55d + 0.5d); return cmyk; }