Пример #1
0
        public static EntityColor CreateFrom(ArgbColor color)
        {
            int   colorDifference;
            short colorIndex = DxfIndexedColorSet.GetColorIndex(color, out colorDifference);

            if (colorDifference != 0)
            {
                return(EntityColor.CreateFromRgb(color.Argb));
            }
            return(EntityColor.CreateFromColorIndex(colorIndex));
        }
Пример #2
0
 public override void imethod_10(
     EntityColor color,
     Transparency transparency,
     bool isColorBookColor)
 {
     if (color == EntityColor.ByBlock && !isColorBookColor)
     {
         this.imethod_32((short)0);
     }
     else
     {
         ushort num = 0;
         bool   flag;
         if (flag = transparency.TransparencyType != TransparencyType.ByLayer)
         {
             num |= (ushort)8192;
         }
         if (isColorBookColor)
         {
             this.imethod_32((short)(ushort)((uint)num | 49152U));
         }
         else if (color == EntityColor.ByLayer)
         {
             this.imethod_32((short)(ushort)((uint)num | 256U));
         }
         else if (color.ColorType == ColorType.ByColorIndex)
         {
             this.imethod_32((short)(ushort)((uint)num | (uint)(ushort)color.ColorIndex));
         }
         else
         {
             int colorDifference;
             int colorIndex = (int)DxfIndexedColorSet.GetColorIndex(color.ToArgbColor(), out colorDifference);
             this.imethod_32((short)(ushort)((uint)num | (uint)(ushort)(32768 | colorIndex)));
             this.imethod_33((int)color.Data);
         }
         if (!flag)
         {
             return;
         }
         this.imethod_33((int)transparency.Data);
     }
 }
Пример #3
0
        public override void imethod_6(Color color)
        {
            switch (color.ColorType)
            {
            case ColorType.ByLayer:
                this.imethod_32((short)256);
                break;

            case ColorType.ByBlock:
                this.imethod_32((short)0);
                break;

            case ColorType.ByColorIndex:
                this.imethod_32(color.ColorIndex);
                break;

            default:
                this.imethod_32(DxfIndexedColorSet.GetColorIndex((DxfIndexedColor)DxfIndexedColorSet.AcadClassicIndexedColors, color.ToArgbColor(DxfIndexedColorSet.AcadClassicIndexedColors)));
                break;
            }
        }