Module material_colors::contrast

source ·

Functions§

  • Returns a tone <= [tone] that ensures [ratio]. Return value is between 0 and 100. Returns -1 if [ratio] cannot be achieved with [tone].
  • Returns a tone <= [tone] that ensures [ratio]. Return value is between 0 and 100. Returns 0 if [ratio] cannot be achieved with [tone].
  • Returns a tone >= [tone] that ensures [ratio]. Return value is between 0 and 100. Returns -1 if [ratio] cannot be achieved with [tone].
  • Returns a tone >= [tone] that ensures [ratio]. Return value is between 0 and 100. Returns 100 if [ratio] cannot be achieved with [tone].
  • Returns a contrast ratio, which ranges from 1 to 21.