Difference between revisions of Template:VisionStats

Jump to navigation Jump to search
(Added colors for sphere. (Cylinder severity is relative to sphere, so that would need to be a different calculation.))
(Simplified.)
Line 6: Line 6:
|-
|-
! [[Sphere]]
! [[Sphere]]
| {{#switch:
| style="background-color: {{#switch:
{{#expr: {{{left sphere}}} > -1 }}{{#expr: {{{left sphere}}} > -2 }}{{#expr: {{{left sphere}}} > -5 }}{{#expr: {{{left sphere}}} > -10 }}
{{#expr: {{{left sphere}}} > -1 }}{{#expr: {{{left sphere}}} > -2 }}{{#expr: {{{left sphere}}} > -5 }}{{#expr: {{{left sphere}}} > -10 }}
| 1111 = style="background-color: green;"
| 1111 = green
| 0111 = style="background-color: yellow;"
| 0111 = yellow
| 0011 = style="background-color: orange;"
| 0011 = orange
| 0001 = style="background-color: red;"
| 0001 = red
| #default = style="background-color: purple;"
| #default = purple
}} | {{{left sphere|}}}
}};" | {{{left sphere|}}}
| {{#switch:
| style="background-color: {{#switch:
{{#expr: {{{right sphere}}} > -1 }}{{#expr: {{{right sphere}}} > -2 }}{{#expr: {{{right sphere}}} > -5 }}{{#expr: {{{right sphere}}} > -10 }}
{{#expr: {{{right sphere}}} > -1 }}{{#expr: {{{right sphere}}} > -2 }}{{#expr: {{{right sphere}}} > -5 }}{{#expr: {{{right sphere}}} > -10 }}
| 1111 = style="background-color: green;"
| 1111 = green
| 0111 = style="background-color: yellow;"
| 0111 = yellow
| 0011 = style="background-color: orange;"
| 0011 = orange
| 0001 = style="background-color: red;"
| 0001 = red
| #default = style="background-color: purple;"
| #default = purple
}} | {{{right sphere|}}}
}};" | {{{right sphere|}}}
|- {{#if: {{{left cylinder|}}}{{{right cylinder|}}} | | style="display: none;" }}
|- {{#if: {{{left cylinder|}}}{{{right cylinder|}}} | | style="display: none;" }}
! [[Cylinder]]
! [[Cylinder]]

Revision as of 05:49, 27 May 2020

This template is used for showing off your current prescription.

Documentation

All fields are optional.

Example: {{VisionStats | title = Normalised | left sphere = -5.00 | right sphere = -5.50 | left cylinder = -1.50 | right cylinder = -1.75 | left axis = 005 | right axis = 160 | left prism = 0.5 BU | right prism = 0.5 BD }}

Produces:

Normalised
Left Right
Sphere -5.00 -5.50
Cylinder -1.50 -1.75
Axis 005 160
Prism 0.5 BU 0.5 BD