Section 2.2 of the xcolor manual lists the various available colour models. One of them is called
HTML and it says:
HTML This is a model derived from rgb in order to enable input of color parameters from web pages or CSS files. Therefore, it is not really a color model of
its own right, but rather a user interface for convenience. It is worth mentioning
that HTML accepts any combination of the characters 0–9, A–F, a–f, as long as
the string has a length of exactly 6 characters. However, outputs of conversions
to HTML will always consist of numbers and uppercase letters.
This means that whenever an
xcolor command allows you to specify a colour model, you can put
HTML in for the model to use the
HTML syntax. An example is given near the start of Section 2.2:
(As I typed this, Jannis posted an answer explaining how to do this with the
Of course, the colours in your document might not be exactly the same as those on your webpage, but that's due more to the complexity of colour than the
xcolor package. Take a look at PDF colour model and LaTeX for more on this.