Date : Thu, 04 Nov 2010 11:56:48 +0000
From : groupsstuff@... (Farlie A)
Subject: Programming: Colour names in Sigsumeidsi
OK So this is more a programming exercise than strictly a BBC Micro post
(I might also post this to the BB4W Yahoo group in time.)
In a constructed language I partially developed (Sigsumeidsi if you want
to look it up),
colours rather than being yellow , orange etc. were defined slightly
differently.
Colours in Sigsumeidsi were defined as being made up of ra,ga and ba
(strictly speaking red accumulator,
blue accumulator, green accumulator respectively)
Pure colours are indicated with 'ov' in front of the relevant colour :
hence saturated red in Sigsumedsi is 'ovra' ( technically overflow
red accumulator)
'ovba','ovga' being the equivalent of saturated green and blue
respectively.
The 'absence' of ra,ga, or ba is indicated by 'nul'.
Hence yellow is 'nulba' ( nothing Blue Accumlator).
This makes the basic set of colours (additive) :
'Saturated' White - suovasi (set of overflowed accumlators)
Black - sunulasi ( set of null accumulators) ,
Red - ovra
Blue - ovba
Green - ovga
Yellow - nulba
Cyan - nulra
Magenta - nulga
Other colors can be defined as :
: As being a fraction of the basic colours
Numbers in Sigsumeidsi are nominally base 16 and work on a combination
as follows.
id = &1
bi = &2
tet = &4
oct = &8
hex = &10
the expression 'it' acts as a BASE 16 left shift operator, hence :
idit = hex =&10
bi't = &20
teti = &40
octit =&80
hexit= &100
Math operations like a division ('rip') are defined prefix ( ie operand
operand operation), sigsumedsi is
a bit like FORTH in that respect :) .
Baisc math operations are :
rip (divide)
mul tiply
a dd
una dd (Subtract)
Sometimes a seeming math operation will be sued when defining a number,
hence
(&FF = is hexitiduna = &100-1 )
For example a simple dark green might be :
ovgabirip (Overflow green accumlater 1/2 level.)
Wheras an obvious but not staurated green might be :
ovgatetripidbimul (overflow green accumulator 3/4 level)
This method is often used when dealing with shades of a particular pure
color.
The other method used is to define the color directly using a number in
the range &0-&FF ( nul - hexitiduna) for the
ra,ba and ga components respectively.
For convenience , ovra is considered equivalent to
hexitudnaranulbanulga even though ovra is
in it's more literal sense an 'overflow' beyond that value.
There are other equivlances, which should be reasonably obvious.
The programming exercise is to convert between RGB(or HTML colors) and
the 'simplest' possible
Sigsumeidsi color name , if desired English translations could be added
as well.
I already have my own thoughts about how to program a simple translator,
I'm just interested in what other
people here thought. I am also aware of one flaw with the above if
anyone wants to point it out...
Alex Farlie.