الانتقال إلى المحتوى الرئيسي

فاحص تباين الألوان الذكي وفق معايير WCAG 2.2

قياس نسبة التباين بين النصوص وعناصر الواجهة والخلفيات وفق معايير W3C WCAG 2.2 مع اقتراحات ذكية لتعديل الألوان محلياً لتحقيق توافق AA و AAA.

فاحص التباين جاهز. أدخل أو حدد الألوان لتقييم التوافق.
WCAG 2.2 AA / AAA

فاحص تباين الألوان WCAG 2.2

تحديد الألوان

نماذج ألوان متباينة شائعة
نسبة التباين المحسوبةتباين فائق (مطابق لمعيار AAA)
14.63:1

نسبة النصوع المحسوبة بالمعادلة الرسمية لـ W3C WCAG 2.2 وهي (L1 + 0.05) / (L2 + 0.05).

النصوص العادية✓ AA
النصوص الكبيرة✓ AA
العناصر الرسومية وواجهة المستخدم✓ AA

نتائج تقييم التوافق مع WCAG 2.2

النصوص العادية

١٦ بكسل / عادي

نصوص الفقرات وحقول الإدخال أقل من 18pt (24px) أو 14pt (18.66px) عريض

المستوى AA (>= 4.5:1)ناجح
المستوى AAA (>= 7.0:1)ناجح

النصوص الكبيرة

>= ٢٤ بكسل / ١٨.٦٦ بكسل عريض

العناوين والنصوص الكبيرة بمقاس 18pt (24px) أو 14pt (18.66px) عريض على الأقل

المستوى AA (>= 3.0:1)ناجح
المستوى AAA (>= 4.5:1)ناجح

العناصر الرسومية وواجهة المستخدم

SC 1.4.11

حدود الحقول والأزرار والأيقونات الأساسية (WCAG 2.2 SC 1.4.11)

المستوى AA (>= 3.0:1)ناجح
* معيار WCAG SC 1.4.11 يحدد تباين المحتوى غير النصي في المستوى AA فقط (لا يوجد معيار AAA).

معاينة مباشرة في الوقت الفعلي

نصوص الفقرات العادية (16px / 400)

يعد التباين اللوني الجيد حجر الأساس للتصميم الرقمي الشامل. فهو يضمن وضوح القراءة تحت مختلف ظروف الإضاءة وللأشخاص الذين يعانون من ضعف الرؤية أو عمى الألوان.

العناوين والخطوط الكبيرة (24px / 700)

خطوط واضحة وسهلة القراءة للجميع

عناصر واجهة المستخدم التفاعلية (WCAG SC 1.4.11)
شارة الحالة

مساعد الاقتراح والتعديل الذكي للألوان

هل تحتاج إلى ألوان مطابقة؟ قم بتثبيت الخلفية أو النص للبحث في نطاق sRGB عن أقرب لون بديل يحقق النسبة المطلوبة بأقل انحراف لوني (ΔE).

تثبيت اللون
نسبة التوافق المستهدفة

الألوان الحالية متوافقة بالفعل مع نسبة التباين المستهدفة وتتجاوزها! (14.63:1 >= 4.5:1)

How WCAG 2.2 Color Contrast Works

Digital accessibility depends fundamentally on sufficient perceptual contrast between text, interface elements, and their background surfaces. The W3C Web Content Accessibility Guidelines (WCAG 2.2) establish clear mathematical criteria to ensure digital interfaces remain completely legible and operable for people with moderately low vision, color vision deficiencies (protanopia, deuteranopia, tritanopia), aging eyes, and under adverse ambient lighting conditions.

The W3C Relative Luminance & Contrast Formula

Contrast in WCAG is calculated using the relative luminance of colors in the standard sRGB color space. The relative luminance (L) of an sRGB color is determined by linearizing each 8-bit color channel (R, G, B) and weighting them according to human spectral eye sensitivity:

L = 0.2126 * R_linear + 0.7152 * G_linear + 0.0722 * B_linear
Where C_linear = (C / 255 <= 0.04045) ? (C / 255) / 12.92 : ((C / 255 + 0.055) / 1.055)^2.4

The contrast ratio between two colors is then defined as:

Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)

Where L1 is the relative luminance of the lighter color and L2 is the relative luminance of the darker color. The addition of the 0.05 offset represents ambient flare compensation. This yields a ratio ranging from 1.0:1 (identical colors) up to 21.0:1 (pure black on pure white).

WCAG 2.2 Success Criteria & Thresholds

  • Normal Text (WCAG SC 1.4.3 & 1.4.6): Body text, form field labels, and descriptions require at least 4.5:1 for Level AA and 7.0:1 for enhanced Level AAA.
  • Large Text (WCAG SC 1.4.3 & 1.4.6): Text that is at least 18pt (24px) regular weight or 14pt (18.66px) bold requires at least 3.0:1 for Level AA and 4.5:1 for Level AAA.
  • Graphical Objects & User Interface Components (WCAG SC 1.4.11): Visual information required to identify user interface components (such as form field borders, button outlines, and active state indicators) and graphical objects (such as standalone icons and chart elements) requires at least 3.0:1. Note that the W3C specification defines non-text contrast at Level AA only, without an AAA requirement.

Smart In-Gamut Color Remediation

When a selected color pairing fails your target contrast ratio, our remediation optimizer allows you to hold either the foreground or background color fixed. The engine searches candidate colors along the sRGB lightness dimension to find the exact counterpart that satisfies the selected target ratio (3.0:1, 4.5:1, or 7.0:1) while strictly minimizing the Euclidean color distance (ΔE) to your original design.

Frequently Asked Questions

كيف يتم احتساب نسبة التباين في WCAG 2.2؟
تُحسب النسبة عبر معادلة W3C القياسية (L1 + 0.05) / (L2 + 0.05)، حيث يمثل L1 النصوع النسبي للون الفاتح و L2 للون الداكن في فضاء sRGB، وتتراوح النسبة من 1:1 إلى 21:1.
ما هو الفرق بين المستوى AA والمستوى AAA في WCAG؟
المستوى AA هو المطلب القانوني والتجاري القياسي عالمياً لمواقع الويب. أما المستوى AAA فيوفر تبايناً معززاً (7.0:1 للنصوص العادية) للأشخاص ذوي الإعاقات البصرية الشديدة.
هل توجد متطلبات مستوى AAA لعناصر واجهة المستخدم غير النصية؟
لا. معيار النجاح 1.4.11 (تباين العناصر غير النصية) محدد حصرياً عند المستوى AA بنسبة 3.0:1 كحد أدنى، ولا يوجد أي اشتراط لمستوى AAA في هذا المعيار.
كيف تعمل خوارزمية اقتراح الألوان البديلة؟
تقوم الخوارزمية بتثبيت اللون الأساسي والبحث عبر محور الإضاءة في فضاء sRGB عن اللون الذي يحقق التوافق المطلوب مع تقليل المسافة اللونية الإقليدية (ΔE) عن التصميم الأصلي.