Skip to content

Commit

Permalink
Made method names more-regular
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesBHuff committed Jun 24, 2023
1 parent 21ee8ad commit 07c7b97
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/content/wcag-results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
const backgroundLab = computed(() => rgbToLab(props.background));
const enum MethodType {
WCAG = 0,
Lab_WCAG = 1,
WCAG_RGB = 0,
WCAG_Lab = 1,
CIEDE2000 = 2,
}
const method: Ref<MethodType> = ref(MethodType.WCAG);
const method: Ref<MethodType> = ref(MethodType.WCAG_RGB);
const contrast = computed(() => {switch(method.value) {
case MethodType.WCAG:
case MethodType.WCAG_RGB:
return rgbToContrast(props.foreground, props.background);
case MethodType.Lab_WCAG:
case MethodType.WCAG_Lab:
return labToContrast(foregroundLab.value, backgroundLab.value);
case MethodType.CIEDE2000:
return labToDifference(foregroundLab.value, backgroundLab.value);
}});
const contrastDeviance = computed(() => {switch(method.value) {
case MethodType.WCAG:
case MethodType.WCAG_RGB:
return 1;
case MethodType.Lab_WCAG:
case MethodType.WCAG_Lab:
return 1.92 / 4.54; // The difference between Lab-luminance contrast-ratio and WCAG-luminance contrast-ratio for #767676, the gray closest to a 4.5 CR in WCAG.
case MethodType.CIEDE2000:
Expand Down Expand Up @@ -69,8 +69,8 @@
<div id="method">
<label for="method">Method:</label>
<select name="method" v-model="method" required>
<option :value="MethodType.WCAG">WCAG</option>
<option :value="MethodType.Lab_WCAG">Lab WCAG</option>
<option :value="MethodType.WCAG_RGB">WCAG (RGB)</option>
<option :value="MethodType.WCAG_Lab">WCAG (Lab)</option>
<option :value="MethodType.CIEDE2000">CIEDE2000</option>
</select>
<span></span>
Expand Down

0 comments on commit 07c7b97

Please sign in to comment.