ثيمات وألوان إكسل
كيفية تطبيق وإنشاء مخطط الألوان في إكسل
تجعل مواضيع المستند من السهل تنسيق ألوان وخطوط وتأثيرات تنسيق الرسومات للوثائق وتحديثها بسرعة. المواضيع توفر مظهرًا موحدًا مع الأنماط المسماة والتأثيرات البصرية والكائنات الأخرى المستخدمة في دفتر العمل. على سبيل المثال، الأنماط المميزة 1، على سبيل المثال، تظهر بشكل مختلف في موضوعات Office و Apex. في كثير من الأحيان، تطبق موضوع المستند ومن ثم تعدله إلى الشكل الذي تريده.
كيفية تطبيق مخطط لون في إكسل
- افتح Excel وانتقل إلى علامة “تخطيط الصفحة” في شريط الأدوات.
- انقر على زر “الألوان” في قسم “الثيمات”.
- اختر لوحة ألوان تتناسب مع متطلباتك أو قم بتحويل المؤشر فوق نظام لرؤية معاينة مباشرة.
كيفية إنشاء مجموعة ألوان مخصصة في إكسيل
يمكنك إنشاء مجموعة ألوان خاصة بك لإعطاء مستندك مظهرًا جديدًا وفريدًا أو لتلائم معايير علامة تجارية منظمتك.
-
افتح Excel وانتقل إلى علامة “تخطيط الصفحة” في شريط الأدوات.
-
انقر على زر “الألوان” في قسم “الثيمات”.
-
انقر على زر “تخصيص الألوان…”.
-
في مربع الحوار “إنشاء ألوان ثيم جديدة”، يمكنك اختيار الألوان لكل عنصر عن طريق النقر على القوائم المنسدلة للألوان بجوارها. يمكنك اختيار الألوان من اللوحة أو تعريف ألوان مخصصة باستخدام خيار “مزيد من الألوان”.
-
بعد اختيار جميع الألوان المطلوبة، قم بتوفير اسم لمجموعة الألوان المخصصة في حقل “الاسم”.
-
انقر على زر “حفظ” لحفظ مجموعة الألوان المخصصة الخاصة بك. ستكون مجموعة الألوان المخصصة الخاصة بك الآن متاحة في قائمة الألوان المنسدلة للاستخدام المستقبلي.
كيفية إنشاء وتطبيق نظام الألوان في Aspose.Cells لبايثون via .NET
يوفر Aspose.Cells لبايثون via .NET ميزات لتخصيص السمات والألوان.
كيفية إنشاء موضوع لون مخصص في Aspose.Cells لبايثون via .NET
إذا تم استخدام ألوان الثيمة في الملف، فليس من الضروري تعديل كل خلية بشكل فردي، بل نحتاج فقط إلى تعديل الألوان في الثيمة.
المثال التالي يوضح كيفية تطبيق ثيمات مخصصة باستخدام الألوان المرغوبة. نحن نستخدم ملف قالب عيني تم إنشاؤه يدويًا في Microsoft Excel 2007.
المثال التالي يحمل ملف XLSX قالبيًا، يحدد الألوان لأنواع مختلفة من الألوان الثيمية، بالإضافة إلى تطبيق الألوان المخصصة وحفظ ملف إكسيل.
from aspose.cells import Workbook,License,PdfSaveOptions, LoadOptions, LoadFormat, LoadFilter, LoadDataFilterOptions, PasteOptions,PasteType | |
from aspose.pydrawing import Color | |
# For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Instantiate Workbook object. | |
# Open an exiting excel file. | |
workbook = Workbook(dataDir + "book1.xlsx") | |
# Define Color array (of 12 colors) for Theme. | |
colors = [] | |
colors.append(Color.from_argb(255, 250, 235, 215)) # Background1 | |
colors.append(Color.from_argb(255, 165, 42, 42)) # Text1 | |
colors.append(Color.from_argb(255, 240, 248, 255)) # Background2 | |
colors.append(Color.from_argb(255, 255, 255, 0)) # Text2 | |
colors.append(Color.from_argb(255, 154, 205, 50)) # Accent1 | |
colors.append(Color.from_argb(255, 255, 0, 0)) # Accent2 | |
colors.append(Color.from_argb(255, 255, 192, 203)) # Accent3 | |
colors.append(Color.from_argb(255, 128, 0, 128)) # Accent4 | |
colors.append(Color.from_argb(255, 152, 251, 152)) # Accent5 | |
colors.append(Color.from_argb(255, 255, 165, 0)) # Accent6 | |
colors.append(Color.from_argb(255, 0, 128, 0)) # Hyperlink | |
colors.append(Color.from_argb(255, 128, 128, 128)) # Followed Hyperlink | |
# Set the custom theme with specified colors. | |
workbook.custom_theme("CustomeTheme1", colors) | |
# Save as the excel file. | |
workbook.save(dataDir + "output.out.xlsx") |
كيفية تطبيق ألوان السمة في Aspose.Cells لبايثون via .NET
المثال التالي يطبق ألوان الخلفية والخط لخلية استنادًا إلى أنواع ألوان الثيمة الافتراضية (للجدول). يحفظ أيضًا ملف إكسيل على القرص.
from aspose.cells import BackgroundType, ThemeColor, ThemeColorType, Workbook | |
from os import os, path | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create directory if it is not already present. | |
IsExists = path.isdir(dataDir) | |
if notIsExists: | |
os.makedirs(dataDir) | |
# Instantiate a Workbook. | |
workbook = Workbook() | |
# Get cells collection in the first (default) worksheet. | |
cells = workbook.worksheets[0].cells | |
# Get the D3 cell. | |
c = cells.get("D3") | |
# Get the style of the cell. | |
s = c.get_style() | |
# Set foreground color for the cell from the default theme Accent2 color. | |
s.foreground_theme_color = ThemeColor(ThemeColorType.ACCENT2, 0.5) | |
# Set the pattern type. | |
s.pattern = BackgroundType.SOLID | |
# Get the font for the style. | |
f = s.font | |
# Set the theme color. | |
f.theme_color = ThemeColor(ThemeColorType.ACCENT4, 0.1) | |
# Apply style. | |
c.set_style(s) | |
# Put a value. | |
c.put_value("Testing1") | |
# Save the excel file. | |
workbook.save(dataDir + "output.out.xlsx") |
كيفية الحصول على وأعداد ألوان السمة في Aspose.Cells لبايثون via .NET
فيما يلي بعض الطرق والخصائص التي تنفذ فيها ألوان الثيم.
- Style.foreground_theme_color: يستخدم لتعيين لون النص الأمامي.
- Style.background_theme_color: يستخدم لتعيين لون الخلفية.
- Font.theme_color: يستخدم لتعيين لون الخط.
- Workbook.get_theme_color: يستخدم للحصول على لون ثيم.
- Workbook.set_theme_color: يستخدم لتعيين لون ثيم.
المثال التالي يوضح كيفية الحصول على وتعيين ألوان الثيم.
المثال التالي يستخدم ملف XLSX قالب، يحصل على الألوان لأنواع مختلفة من الألوان الثيم، يقوم بتغيير الألوان ويحفظ ملف Microsoft Excel.
from aspose.cells import ThemeColorType, Workbook | |
from aspose.pydrawing import Color | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Instantiate Workbook object. | |
# Open an exiting excel file. | |
workbook = Workbook(dataDir + "book1.xlsx") | |
# Get the Background1 theme color. | |
c = workbook.get_theme_color(ThemeColorType.BACKGROUND1) | |
# Print the color. | |
print("theme color Background1: " + str(c)) | |
# Get the Accent2 theme color. | |
c = workbook.get_theme_color(ThemeColorType.ACCENT2) | |
# Print the color. | |
print("theme color Accent2: " + str(c)) | |
# Change the Background1 theme color. | |
workbook.set_theme_color(ThemeColorType.BACKGROUND1, Color.red) | |
# Get the updated Background1 theme color. | |
c = workbook.get_theme_color(ThemeColorType.BACKGROUND1) | |
# Print the updated color for confirmation. | |
print("theme color Background1 changed to: " + str(c)) | |
# Change the Accent2 theme color. | |
workbook.set_theme_color(ThemeColorType.ACCENT2, Color.blue) | |
# Get the updated Accent2 theme color. | |
c = workbook.get_theme_color(ThemeColorType.ACCENT2) | |
# Print the updated color for confirmation. | |
print("theme color Accent2 changed to: " + str(c)) | |
# Save the updated file. | |
workbook.save(dataDir + "output.out.xlsx") |