اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
يتألف كل منها من مجموعة من 13 لونًا بقيم مختلفة ومحدّدة للإضاءة
كما هو موضّح في
R.color،
ولكن بقيم لم يتم تحديدها للصبغة والتشبع يمكن أن يتم إنشاؤها ديناميكيًا من قِبل
نظام Android أثناء التشغيل.
أنماط المظاهر للألوان الديناميكية
بدءًا من Android 13، أصبح من الممكن استخدام ستة أنماط مختلفة للموضوعات
مع اختلافات في خوارزمية الألوان الديناميكية التي تحافظ على
احتياجات المطوّرين وتلبي توقعاتهم بشأن التباين. يتم إدراج هذه الألوان لإنشاء
65 لونًا ديناميكيًا تستخدمه التطبيقات:
TONAL_SPOT هي لوحة ألوان متوسطة السطوع تستخدم لون system_accent3_0
مشابهًا للون system_accent1_0 (تم نقله من إصدار Android 12
وتعديله قليلاً).
VIBRANT هي لوحة ألوان عالية السطوع تمزج بشكل متناسق بين الألوان.
EXPRESSIVE هي لوحة ألوان نابضة بالحياة تجمع بين ألوان التمييز
غير المتوقّعة والفريدة.
SPRITZ هي لوحة ألوان منخفضة السطوع تُضفي لمسة ناعمة على الألوان.
يستخدم RAINBOW كلًّا من اللمسات اللونية والسطوح المحايدة لتوفير تجربة ألوان
أكثر دقة للمستخدمين.
لا يُنصح باستخدام هذه الطريقة مع ميزة تحليل ألوان
الخلفية، ويجب استخدامها بدلاً من ذلك مع مظاهر الألوان الثابتة.
FRUIT_SALAD يوفّر درجتَي لون لمنح المستخدمين مزيدًا من التعبير.
لا يُنصح باستخدام هذه الطريقة مع ميزة تحليل ألوان
الخلفية، ويجب استخدامها بدلاً من ذلك مع مظاهر الألوان الثابتة.
يتم ضبط مظهر النظام وفقًا للإعداد نفسه في Android 12، وهو Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES. بالنسبة إلى الإصدار
13 من Android، لا يتطلب سوى مفتاح واحد في ملف JSON يُرسِل
اللون المصدر لإنشاء لوحات الألوان الـ 65:
تحتوي كل لوحة ألوان على 13 قيمة لون تنتهي بالمؤشرات 0 و10 و50 و100
و200 و300 و400 و500 و600 و700 و800 و900 و1000.
واجهة برمجة التطبيقات الناتجة هي عبارة عن تركيبة من اسم لوحة الألوان، وتنتهي بالملف الشخصي. على سبيل المثال:
R.color#system_accent1_10
كيف يتم إنشاء لوحة ألوان ديناميكية؟
يجب إنشاء لوحة ألوان ديناميكية من لون مصدر واحد يجب
أن يتم استخراجه من الخلفية باستخدام
com.android.systemui.monet.ColorScheme#getSeedColors، الذي يقدّم عدة
ألوان مصدر صالحة. إذا لم يستوفِ أيّ من الألوان المقدَّمة متطلبات لون المصدر، يجب استخدام القيمة 0xFF1B6EF3 مع لون المصدر الوحيد.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-24 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-24 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Dynamic color\n\nMaterial You design was launched with the Android 12\nrelease and expanded with Android 13.\n\nThis page focuses on updates to the Material You logic to help you integrate\nwith richer dynamic color support.\n\nDynamic color tonal palettes\n----------------------------\n\nStarting with Android 12, the following dynamic color\ntonal palettes are supported:\n\n- [`system_accent1_0`](https://developer.android.com/reference/android/R.color#system_accent1_0)\n- [`system_accent2_0`](https://developer.android.com/reference/android/R.color#system_accent2_0)\n- [`system_accent3_0`](https://developer.android.com/reference/android/R.color#system_accent3_0)\n- [`system_neutral1_0`](https://developer.android.com/reference/android/R.color#system_neutral1_0)\n- [`system_neutral2_0`](https://developer.android.com/reference/android/R.color#system_neutral2_0))\n\nEach of them comprise of a set of 13 colors with defined various luminance\nvalues as described at\n[`R.color`](https://developer.android.com/reference/android/R.color),\nbut with undefined hue and chroma values that can be dynamically generated by\nthe Android system at runtime.\n\nTheme styles for dynamic color\n------------------------------\n\nStarting with Android 13, six different theme styles\nare supported with variations on the dynamic color algorithm that maintain\ndeveloper needs and contrast expectations. These are listed for generating the\n65 dynamic color used by apps:\n\n- `TONAL_SPOT` is a mid-vibrancy palette that uses an `system_accent3_0` color analogous to the `system_accent1_0` color (carried over from the Android 12 release and slightly adjusted).\n- `VIBRANT` is a high-vibrancy palette that harmoniously blends subtle shift between colors.\n- `EXPRESSIVE` is a high-vibrancy palette that pairs unexpected and unique accents colors together.\n- `SPRITZ` is a low-vibrancy palette that creates a soft wash between colors.\n- `RAINBOW` uses both chromatic accents and neutral surfaces to create a more subtle color experience for users.\n - This is **NOT RECOMMENDED** to be used with wallpaper-based color extraction and should instead be used with static color themes.\n- `FRUIT_SALAD` provides *two tone colors* to give users more expression.\n - This is **NOT RECOMMENDED** to be used with wallpaper-based color extraction and should instead be used with static color themes.\n\nThe system theme is driven by the same setting as it was in Android 12,\nwhich is `Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES`. For Android\n13, it requires only one key on its JSON that sends the\nsource color to generate the 65 color palettes: \n\n {\n \"android.theme.customization.system_palette\":\"746BC1\"\n }\n\nThe default theme style is `TONAL_SPOT`, but you can optionally specify one of\nthe other theme styles with an additional key with the JSON above: \n\n {\n \"android.theme.customization.system_palette\":\"746BC1\"\n \"android.theme.customization.theme_style\":\"EXPRESSIVE\"\n }\n\n| **Note:** You aren't required to expose ALL of the new theme styles in your UI, and can decide which to expose based on your user/brand needs. However, dynamic color palettes **MUST** be generated through one of these theme styles as CTS-tested by `SystemPaletteTest#testThemeStyles` and mandated by CDD.\n\nIntegrating dynamic color\n-------------------------\n\nFor guidelines on integrating dynamic color, see [Integrating Material You\nDesign](/docs/core/display/material).\n\nFrequently asked questions (FAQs)\n---------------------------------\n\n### What does the dynamic tonal palette API include?\n\n- There are five tonal palettes:\n\n - [`system_accent1`](https://developer.android.com/reference/android/R.color#system_accent1_0)\n - [`system_accent2`](https://developer.android.com/reference/android/R.color#system_accent2_0)\n - [`system_accent3`](https://developer.android.com/reference/android/R.color#system_accent3_0)\n - [`system_neutral1`](https://developer.android.com/reference/android/R.color#system_neutral1_0)\n - [`system_neutral2`](https://developer.android.com/reference/android/R.color#system_neutral2_0)\n- Each tonal palette has 13 color values ending in the indexes 0, 10, 50, 100,\n 200, 300, 400, 500, 600, 700, 800, 900, and 1000.\n\n- The resulting API is a combination of the tonal palette name, ending in the\n index. For example:\n [`R.color#system_accent1_10`](https://developer.android.com/reference/android/R.color#system_accent1_10)\n\n### How is a dynamic tonal pallet generated?\n\nA dynamic tonal palette must be generated from a single source color that should\nbe derived from wallpaper using\n`com.android.systemui.monet.ColorScheme#getSeedColors`, which provides multiple\nvalid source colors. If none of the provided colors meet the source color\nrequirement, the single source color should use the value `0xFF1B6EF3`."]]