Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a234841e9acdb1bb

Jump to content

Template:Random color/doc

From Wikipedia, the free encyclopedia

Usage

[edit]

Returns six instances of {{Random color/Digit}}, e.g. a hex code. Like this: 39A6B6. If you want to use it more than once on the same page, you need to specify different {{{1}}}s for seeds. Purge

 *1. {{Color sample|#{{Random color|125}}}} {{Random color|125}}
 *2. {{Color sample|#{{Random color|126}}}} {{Random color|126}}
 *3. {{Color sample|#{{Random color|127}}}} {{Random color|127}}
  • 1. 09C6D0
  • 2. 42C8A4
  • 3. 0342F0

Note that invocations with the same seed will generate the same color, like this:

 *1. {{Color sample|#{{Random color|123}}}} {{Random color|123}}
 *2. {{Color sample|#{{Random color|123}}}} {{Random color|123}}
 *3. {{Color sample|#{{Random color|123}}}} {{Random color|123}}
  • 1. 0F4AB0
  • 2. 0F4AB0
  • 3. 0F4AB0

Normally, it generates the colors randomly based on the time. If you want it to deterministically generate random colors (e.g. you're color-coding items in a series based on text, and you want them to be the same no matter what), specify a fixed parameter, like this:

*1. {{Color sample|#{{Random color|120|fixed=y}}}} {{Random color|120|fixed=y}}
*2. {{Color sample|#{{Random color|121|fixed=y}}}} {{Random color|121|fixed=y}}
*3. {{Color sample|#{{Random color|122|fixed=y}}}} {{Random color|122|fixed=y}}
  • 1. 37DF59
  • 2. 7B139D
  • 3. BF57D1

Note that, e.g. using 120 with the fixed param will always produce "37DF59".

You can also use this with {{Tint}} (e.g. if you want to generate lighter, darker, or color-tinted palettes).