ثيمات وألوان إكسل
كيفية تطبيق وإنشاء مخطط الألوان في إكسل
تجعل مواضيع المستند من السهل تنسيق ألوان وخطوط وتأثيرات تنسيق الرسومات للوثائق وتحديثها بسرعة. المواضيع توفر مظهرًا موحدًا مع الأنماط المسماة والتأثيرات البصرية والكائنات الأخرى المستخدمة في دفتر العمل. على سبيل المثال، الأنماط المميزة 1، على سبيل المثال، تظهر بشكل مختلف في موضوعات Office و Apex. في كثير من الأحيان، تطبق موضوع المستند ومن ثم تعدله إلى الشكل الذي تريده.
كيفية تطبيق مخطط لون في إكسل
- افتح Excel وانتقل إلى علامة “تخطيط الصفحة” في شريط الأدوات.
- انقر على زر “الألوان” في قسم “الثيمات”.
- اختر لوحة ألوان تتناسب مع متطلباتك أو قم بتحويل المؤشر فوق نظام لرؤية معاينة مباشرة.
كيفية إنشاء مجموعة ألوان مخصصة في إكسيل
يمكنك إنشاء مجموعة ألوان خاصة بك لإعطاء مستندك مظهرًا جديدًا وفريدًا أو لتلائم معايير علامة تجارية منظمتك.
-
افتح Excel وانتقل إلى علامة “تخطيط الصفحة” في شريط الأدوات.
-
انقر على زر “الألوان” في قسم “الثيمات”.
-
انقر على زر “تخصيص الألوان…”.
-
في مربع الحوار “إنشاء ألوان ثيم جديدة”، يمكنك اختيار الألوان لكل عنصر عن طريق النقر على القوائم المنسدلة للألوان بجوارها. يمكنك اختيار الألوان من اللوحة أو تعريف ألوان مخصصة باستخدام خيار “مزيد من الألوان”.
-
بعد اختيار جميع الألوان المطلوبة، قم بتوفير اسم لمجموعة الألوان المخصصة في حقل “الاسم”.
-
انقر على زر “حفظ” لحفظ مجموعة الألوان المخصصة الخاصة بك. ستكون مجموعة الألوان المخصصة الخاصة بك الآن متاحة في قائمة الألوان المنسدلة للاستخدام المستقبلي.
كيفية إنشاء وتطبيق مجموعة ألوان في Aspose.Cells
توفر Aspose.Cells ميزات لتخصيص الثيمات والألوان.
كيفية إنشاء موضوع ألوان مخصص في Aspose.Cells
إذا تم استخدام ألوان الثيمة في الملف، فليس من الضروري تعديل كل خلية بشكل فردي، بل نحتاج فقط إلى تعديل الألوان في الثيمة.
المثال التالي يوضح كيفية تطبيق ثيمات مخصصة باستخدام الألوان المرغوبة. نحن نستخدم ملف قالب عيني تم إنشاؤه يدويًا في Microsoft Excel 2007.
المثال التالي يحمل ملف XLSX قالبيًا، يحدد الألوان لأنواع مختلفة من الألوان الثيمية، بالإضافة إلى تطبيق الألوان المخصصة وحفظ ملف إكسيل.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Define Color array (of 12 colors) for Theme. | |
Color[] carr = new Color[12]; | |
carr[0] = Color.AntiqueWhite; // Background1 | |
carr[1] = Color.Brown; // Text1 | |
carr[2] = Color.AliceBlue; // Background2 | |
carr[3] = Color.Yellow; // Text2 | |
carr[4] = Color.YellowGreen; // Accent1 | |
carr[5] = Color.Red; // Accent2 | |
carr[6] = Color.Pink; // Accent3 | |
carr[7] = Color.Purple; // Accent4 | |
carr[8] = Color.PaleGreen; // Accent5 | |
carr[9] = Color.Orange; // Accent6 | |
carr[10] = Color.Green; // Hyperlink | |
carr[11] = Color.Gray; // Followed Hyperlink | |
// Instantiate a Workbook. | |
// Open the template file. | |
Workbook workbook = new Workbook(dataDir + "book1.xlsx"); | |
// Set the custom theme with specified colors. | |
workbook.CustomTheme("CustomeTheme1", carr); | |
// Save as the excel file. | |
workbook.Save(dataDir + "output.out.xlsx"); |
كيفية تطبيق ألوان الثيم في Aspose.Cells
المثال التالي يطبق ألوان الخلفية والخط لخلية استنادًا إلى أنواع ألوان الثيمة الافتراضية (للجدول). يحفظ أيضًا ملف إكسيل على القرص.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create directory if it is not already present. | |
bool IsExists = System.IO.Directory.Exists(dataDir); | |
if (!IsExists) | |
System.IO.Directory.CreateDirectory(dataDir); | |
// Instantiate a Workbook. | |
Workbook workbook = new Workbook(); | |
// Get cells collection in the first (default) worksheet. | |
Cells cells = workbook.Worksheets[0].Cells; | |
// Get the D3 cell. | |
Aspose.Cells.Cell c = cells["D3"]; | |
// Get the style of the cell. | |
Style s = c.GetStyle(); | |
// Set foreground color for the cell from the default theme Accent2 color. | |
s.ForegroundThemeColor = new ThemeColor(ThemeColorType.Accent2, 0.5); | |
// Set the pattern type. | |
s.Pattern = BackgroundType.Solid; | |
// Get the font for the style. | |
Aspose.Cells.Font f = s.Font; | |
// Set the theme color. | |
f.ThemeColor = new ThemeColor(ThemeColorType.Accent4, 0.1); | |
// Apply style. | |
c.SetStyle(s); | |
// Put a value. | |
c.PutValue("Testing1"); | |
// Save the excel file. | |
workbook.Save(dataDir + "output.out.xlsx"); |
كيفية الحصول على وتعيين ألوان الثيم في Aspose.Cells
فيما يلي بعض الطرق والخصائص التي تنفذ فيها ألوان الثيم.
- Style.ForegroundThemeColor: يستخدم لتعيين لون النص الأمامي.
- Style.BackgroundThemeColor: يستخدم لتعيين لون الخلفية.
- Font.ThemeColor: يستخدم لتعيين لون الخط.
- Workbook.GetThemeColor: يستخدم للحصول على لون ثيم.
- Workbook.SetThemeColor: يستخدم لتعيين لون ثيم.
المثال التالي يوضح كيفية الحصول على وتعيين ألوان الثيم.
المثال التالي يستخدم ملف XLSX قالب، يحصل على الألوان لأنواع مختلفة من الألوان الثيم، يقوم بتغيير الألوان ويحفظ ملف Microsoft Excel.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiate Workbook object. | |
// Open an exiting excel file. | |
Workbook workbook = new Workbook(dataDir + "book1.xlsx"); | |
// Get the Background1 theme color. | |
Color c = workbook.GetThemeColor(ThemeColorType.Background1); | |
// Print the color. | |
Console.WriteLine("theme color Background1: " + c); | |
// Get the Accent2 theme color. | |
c = workbook.GetThemeColor(ThemeColorType.Accent2); | |
// Print the color. | |
Console.WriteLine("theme color Accent2: " + c); | |
// Change the Background1 theme color. | |
workbook.SetThemeColor(ThemeColorType.Background1, Color.Red); | |
// Get the updated Background1 theme color. | |
c = workbook.GetThemeColor(ThemeColorType.Background1); | |
// Print the updated color for confirmation. | |
Console.WriteLine("theme color Background1 changed to: " + c); | |
// Change the Accent2 theme color. | |
workbook.SetThemeColor(ThemeColorType.Accent2, Color.Blue); | |
// Get the updated Accent2 theme color. | |
c = workbook.GetThemeColor(ThemeColorType.Accent2); | |
// Print the updated color for confirmation. | |
Console.WriteLine("theme color Accent2 changed to: " + c); | |
// Save the updated file. | |
workbook.Save(dataDir + "output.out.xlsx"); |