Issue 1:
Bug report

Bug summary

HEX code passed to the color parameter of any Pyplot plots/patches/fills results in incorrect color being rendered.

Code for reproduction

from matplotlib import pyplot as plt
plt.fill_between([0,1],[0,0],[1,1], color='#7818FE')
plt.show()

Actual outcome

Rather than '#7818FE', '#601BFE' is being output. Similarly, plotting '#CCCCCC' results in '#BEBDBE' instead.

Expected outcome

Expects identical color to be output. I don't think this is simply compression artefact, because I have tried to save it as PNG and still the colors are (way) off. Color space issue maybe?

This issue matters because our team has to draw infographics exactly as specified by our designers, and the colors are so wrong that even a red-green color-blind team member can tell the difference between the incorrect colors, in shades of red/green, visually...

The issue is so glaringly obvious that I expect it to have been asked before, but I can't seem to find any previous issue. If this is a duplicate I apologize.

I have asked this same question on Stack Overflow.

Matplotlib version

Operating system: macOS High Sierra 10.13.6

Matplotlib version: 3.0.0, installed from pip

Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline

Python version: 3.6.5

Jupyter version (if applicable): 1.0.0 (same issue also happen with good-ol' .py outside Jupyter)

Other libraries:

Issue 2:
Bug summary

matplotlib.set_loglevel() adds a logging console handler which then leads to duplicate messages in application code. The best practice is to allow the application code to add the handlers to its logger along with formatting, filtering, etc. The existing #13264 attempted to address this.

Code for reproduction

import logging
import matplotlib as mpl
mpl_logger = logging.getLogger("matplotlib")
mpl.set_loglevel("debug")
mpl_logger.hasHandlers()
logger = logging.getLogger()
ch = logging.StreamHandler()
logger.addHandler(ch)
logger.setLevel(logging.DEBUG)
import matplotlib.pyplot as plt

Actual outcome

True

DEBUG:matplotlib:CACHEDIR=C:\Users\ljohnsto.matplotlib

CACHEDIR=C:\Users\ljohnsto.matplotlib

DEBUG:matplotlib.font_manager:Using fontManager instance from C:\Users\ljohnsto.matplotlib\fontlist-v330.json

Using fontManager instance from C:\Users\ljohnsto.matplotlib\fontlist-v330.json

Expected outcome

False

CACHEDIR=C:\Users\ljohnsto.matplotlib

Using fontManager instance from C:\Users\ljohnsto.matplotlib\fontlist-v330.json

Additional information

The workaround is:

In [1]: import logging
In [2]: import matplotlib as mpl
In [3]: mpl_logger = logging.getLogger("matplotlib")
In [4]: mpl.set_loglevel("debug")
In [5]: mpl_logger_handlers = mpl_logger.handlers.copy()
In [6]: for h in mpl_logger_handlers:
...: mpl_logger.removeHandler(h)
...:
In [7]: logger = logging.getLogger()
In [8]: ch = logging.StreamHandler()
In [9]: logger.addHandler(ch)
In [10]: logger.setLevel(logging.DEBUG)
In [11]: import matplotlib.pyplot as plt
CACHEDIR=C:\Users\ljohnsto\.matplotlib
Using fontManager instance from C:\Users\ljohnsto\.matplotlib\fontlist-v330.json
'''

### Operating system

Windows

### Matplotlib Version

3.5.2

### Matplotlib Backend

TkAgg

### Python version

3.9.13

### Jupyter version

_No response_

### Installation

pip