heksa
Converts a number into hex text — base 16.
In base 16 the digits 0–9 carry on with the letters A–F, so 10 is "A" and 15 is "F". It is how web colours are written, as in #FF8000.
By default heksa returns eight digits padded with leading zeros: heksa(20) is "00000014". For something shorter, pass a second number: heksa(20, 2) is "14".
Given a list, it returns a list of strings. The function that goes the other way is paloYaHeksa.
Syntax
Section titled “Syntax”heksa(boleng, dinomoro)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
boleng | palo | The number to convert. A list of numbers is also accepted. |
dinomoro (optional) | palo | How many hex digits to show. Defaults to eight when omitted. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(220);
tlogelaMothalo();
diri khibidu = 255;
diri tala = 128;
kwala(heksa(khibidu, 2));
kwala(heksa(tala, 2));
kwala(heksa(khibidu));
tlatsaMmala(khibidu, tala, 0);
thalaKhutlonne(100, 150, 200, 100);
}