Converting LFS Colours
Last updated
Was this helpful?
Last updated
Was this helpful?
Live for Speed text that includes colours is encoded. This guide will help you to extract the colours from the text.
Imagine you made a call to the and wanted to decode the following nickname: "nickname": "^1[TC]\u00bbPete\u00ab",
. The UTF-8 encoding is not an issue because the browser decodes that automatically for us but the LFS colour prefixes eg. ^1
, will need to be decoded by us before being presented.
Our code examples are available in JavaScript and PHP (change language in the top right).
The list of LFS colour codes is as follows:
Colour
Code
Black
^0
Red
^1
Light Green
^2
Yellow
^3
Blue
^4
Purple
^5
Light Blue
^6
White
^7
Dark Green (Default)
^8
Original text colour and codepage
^9
All of the examples in this guide require the following CSS to properly display the colours:
Try out this example on