public CadColorEditor() { this.InitializeComponent(); for (short colorIndex = 1; colorIndex < (short)256; ++colorIndex) { WW.Cad.Model.Color fromColorIndex = WW.Cad.Model.Color.CreateFromColorIndex(colorIndex); ArgbColor argbColor = fromColorIndex.ToArgbColor(this.dxfIndexedColorSet_0); if ((int)argbColor.R == (int)argbColor.G && (int)argbColor.R == (int)argbColor.B) { this.list_3.Add(fromColorIndex); } if (colorIndex <= (short)9) { this.list_2.Add(fromColorIndex); } } for (short index1 = 0; index1 < (short)5; ++index1) { for (short index2 = 0; index2 < (short)24; ++index2) { short colorIndex = (short)(10 + (int)index1 * 2 + (int)index2 * 5 * 2); this.list_0.Add(WW.Cad.Model.Color.CreateFromColorIndex(colorIndex)); this.list_1.Add(WW.Cad.Model.Color.CreateFromColorIndex((short)((int)colorIndex + 1))); } } this.list_3.Sort((Comparison <WW.Cad.Model.Color>)((a, b) => (int)a.ToArgbColor(this.dxfIndexedColorSet_0).R >= (int)b.ToArgbColor(this.dxfIndexedColorSet_0).R ? 1 : -1)); this.font_0 = this.byLayerButton.Font; this.font_1 = new Font(this.font_0, FontStyle.Bold); this.method_1(this.indexedColorSet1ListPicker, this.list_0); this.method_1(this.indexedColorSet2ListPicker, this.list_1); this.method_1(this.grayColorListPicker, this.list_3); this.method_1(this.standardColorListPicker, this.list_2); }
public ArgbColor GetPlotColor(DxfEntity localBlockContext, WW.Cad.Model.Color color) { ArgbColor argbColor; if (this.graphicsConfig_0.PlotStyleManager != null) { argbColor = this.graphicsConfig_0.PlotStyleManager((IPlotPropertyOwner) new Class1065((IPlotPropertyOwner)localBlockContext, color), this).Color; } else if (color == WW.Cad.Model.Color.ByBlock) { if (localBlockContext.Color == EntityColor.ByLayer) { DxfLayer layer = localBlockContext.GetLayer(this); argbColor = layer == null ? DxfIndexedColor.DefaultColor : layer.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors); } else { argbColor = localBlockContext.DxfColor != null?localBlockContext.DxfColor.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors) : (!(localBlockContext.Color == EntityColor.ByBlock) ? localBlockContext.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors) : (this.dxfColor_0 == null ? this.entityColor_0.ToArgbColor(this.graphicsConfig_0.IndexedColors) : this.dxfColor_0.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors))); } } else if (color == WW.Cad.Model.Color.ByLayer) { DxfLayer layer = localBlockContext.GetLayer(this); argbColor = layer == null ? DxfIndexedColor.DefaultColor : layer.Color.ToArgbColor(this.graphicsConfig_0.IndexedColors); } else { argbColor = color.ToArgbColor(this.graphicsConfig_0.IndexedColors); } return(argbColor); }
internal static short smethod_0(WW.Cad.Model.Color color) { switch (color.ColorType) { case ColorType.ByLayer: return(256); case ColorType.ByBlock: return(0); case ColorType.None: return(0); default: return(DxfIndexedColor.GetColorIndex(color.ToArgbColor(DxfIndexedColorSet.AcadClassicIndexedColors))); } }