class_docstr: Turn dark colors into light colors and the other way around.
  
  This is meant to make color schemes that work on a dark background usable
  on a light background (and the other way around).
  
  Notice that this doesn't swap foreground and background like "reverse"
  does. It turns light green into dark green and the other way around.
  Foreground and background colors are considered individually.
  
  Also notice that when <reverse> is used somewhere and no colors are given
  in particular (like what is the default for the bottom toolbar), then this
  doesn't change anything. This is what makes sense, because when the
  'default' color is chosen, it's what works best for the terminal, and
  reverse works good with that.
class_docstr_tok: ["Turn","dark","colors","into","light","colors","and","the","other","way","around",".","This","is","meant","to","make","color","schemes","that","work","on","a","dark","background","usable","on","a","light","background","(","and","the","other","way","around",")",".","Notice","that","this","does","n't","swap","foreground","and","background","like","``","reverse","''","does",".","It","turns","light","green","into","dark","green","and","the","other","way","around",".","Foreground","and","background","colors","are","considered","individually",".","Also","notice","that","when","<","reverse",">","is","used","somewhere","and","no","colors","are","given","in","particular","(","like","what","is","the","default","for","the","bottom","toolbar",")",",","then","this","does","n't","change","anything",".","This","is","what","makes","sense",",","because","when","the","'default","'","color","is","chosen",",","it","'s","what","works","best","for","the","terminal",",","and","reverse","works","good","with","that","."]
docstr: Return the `Attrs` used when opposite luminosity should be used.
docstr_tok: ["Return","the","`","Attrs","`","used","when","opposite","luminosity","should","be","used","."]
code: def transform_attrs(self, attrs: Attrs) -> Attrs:
      """
      Return the `Attrs` used when opposite luminosity should be used.
      """
      # Reverse colors.
      attrs = attrs._replace(color=get_opposite_color(attrs.color))
      attrs = attrs._replace(bgcolor=get_opposite_color(attrs.bgcolor))
  
      return attrs
  
imports: from __future__ import annotations
  from abc import ABCMeta, abstractmethod
  from colorsys import hls_to_rgb, rgb_to_hls
  from typing import Callable, Hashable, Sequence
  from prompt_toolkit.cache import memoized
  from prompt_toolkit.filters import FilterOrBool, to_filter
  from prompt_toolkit.utils import AnyFloat, to_float, to_str
  from .base import ANSI_COLOR_NAMES, Attrs
  from .style import parse_color
label_desc: Use image node_id 1 for calling the SwapLightAndDarkStyleTransformation obj's underlying member method code with example usage: obj.transform_attrs(attrs) and returns: attrs