Template:Colored text

From Cosmoteer Wiki
Jump to navigation Jump to search

{{{2}}}

Template documentation
view or edit this documentation about template documentation

CalloutIconNote.png
Want to add a brand new custom color? Look no further!
Expand me
To add a new custom color (the ones you can use from this section):

1. Go to the template page, go to edit mode.

2. In the code, find the row of text that says # ======= CUSTOM COLORS ADDED HERE ========= -->.

3. You can add new custom colors under it (see the amber for example).

Use this format:

| c:color-name = value.

- Replace color-name with a name for you color.

- Replace value with a CSS-color value.


4. Press show preview to open a preview of the docs page. If the colors are all gone, you did something wrong.

5. Press Manage TemplateData → press «Color» field → and add to "Suggested values" a name you've used for the color (including the c: part).

6. Press Done and Apply to save and close the window.

7. Save changes to the template page.

8. Add your brand new custom color to the custom colors section on the documentation page for others to see and use.

Colors

Red text using one of the predefined CSS colors: red

{{ColoredText|red|hello world, I'm red}}

This text hello world, I'm red has a custom color.

Gold text using hex code for gold: #ffd700

{{ColoredText|#ffd700|GOLD GOLD GOLD}}

This text GOLD GOLD GOLD has a custom color.

Orange text using HSL: hsl(24, 100%, 50%)

{{ColoredText|hsl(24, 100%, 50%)|orange energy}}

This text orange energy has a custom color.

CosmoGreen text using one of the CSS variables: --color-cosmoGreen

{{ColoredText|--color-cosmoGreen|space green}}

This text space green has a custom color.

Custom amber text using one of the custom colors c:amber

{{ColoredText|c:amber|Custom amber}}

This text amber-brr has a custom color.

List of custom colors
Custom color Result (bold for readability)
c:_const_value This color is ment to be used to color any numerical constant.
c:_enum_name This color is ment to be used to color any enum value name.
c:_important This color is ment to be used to color anything "important", that needs to stand out from anything else.
c:amber A big spaceship traverses the hyperspace.

Modifiers

Disabling inline text

{{ColoredText|inline=0|--color-cosmoGreen|space green}}
This text

space green

is not inline.

Other

Multiline text (inline)

CalloutIconWarning.pngWarning
To add linebreaks use <br>, {{br}} will not work.
This text {{ColoredText|--color-cosmoGreen|space green<br>
moreeee greeen<br>
green}} is multiline inline text.

This text space green
moreeee greeen
green
is multiline inline text.

Multiline text (NOT inline)

This text {{ColoredText|space green{{br}}
moreeee greeen<br>
green|--color-cosmoGreen|inline=0}} is multiline text NOT in inline mode.
This text

space green
moreeee greeen
green

is multiline text NOT in inline mode.


An easy way to give your text a color.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Color1

A CSS-compatible or a custom (starts with "c:") color, like red, #123456, rgb(1, 2, 3), c:amber or even an existing CSS variable, e.g. --color-cosmoGreen. See more on what's supported (for CSS colors): https://developer.mozilla.org/en-US/docs/Web/CSS/color

Suggested values
black silver gray white maroon red purple fuchsia green lime olive yellow navy blue teal aqua aliceblue antiquewhite aquamarine azure beige bisque blanchedalmond blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen gainsboro ghostwhite gold goldenrod greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow limegreen linen magenta mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite oldlace olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue rebeccapurple rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna skyblue slateblue slategray slategrey snow springgreen steelblue tan thistle tomato transparent turquoise violet wheat whitesmoke yellowgreen c:_const_value c:_enum_name c:_important c:amber
Stringrequired
Text2

A text to add a color to.

Contentrequired
Inlineinline

Whether to generate inline text. Enabled by default. Set to any value besides 1 to disable.

Auto value
1
Booleansuggested