Template:Translate name rgb
This is a utility template for translating color name to RGB hex triplet. This is created primarily because the color entry of CSS attribute fails to ignore the number sign (#) when the entry is color name instead of the hex triplet. But unlike the deprecated <font>
element and color
attribute where the number sign is dispensable when entering hex triplet. This creates a dilemma when translating the template syntax from deprecated style definitions to CSS, the system fails to recognize some (mass) of the parameter entries from the transcluding pages due to the presence or absence of the number sign.
Usage
[edit]Only 1 parameter is available in this template:
{{Translate name rgb|blue}}
gives "0000FF".
Note
[edit]Since Wikipedia has not yet implemented the REPLACE string function, user of this template must remove all whitespace or underscore if any in between the term (e.g. dark blue becomes darkblue.) However, this template is not case-sensitive.