def _websafe_component(c, alt=False):
<EOL>sc = c * <NUM_LIT><EOL>d = sc % <NUM_LIT:20><EOL>if d==<NUM_LIT:0>: return c<EOL>l = sc - d<EOL>u = l + <NUM_LIT:20><EOL>if alt:<EOL><INDENT>if (sc-l) >= (u-sc): return l/<NUM_LIT><EOL>else: return u/<NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>if (sc-l) >= (u-sc): return u/<NUM_LIT><EOL>else: return l/<NUM_LIT><EOL><DEDENT>
Convert a color component to its web safe equivalent.

    Parameters:
      :c:
        The component value [0...1]
      :alt:
        If True, return the alternative value instead of the nearest one.

    Returns:
      The web safe equivalent of the component value.