split classes into files for better understanding

- also for excluding some things in the build, as I may not need
 to support PCBoard at revision. Actually, I don't. Later I can
 add that support, but for now, I need the Revision bits working.
This commit is contained in:
Howland Owl 2014-04-05 13:30:28 +03:00
parent 10e8940807
commit 49d411a3d1
15 changed files with 2454 additions and 746 deletions

62
16col/pallette.coffee Normal file
View file

@ -0,0 +1,62 @@
class @ImageTextModePalette
constructor: ( options ) ->
@colors = []
@[k] = v for own k, v of options
toRgbaString: ( color ) ->
return 'rgba(' + color.join( ',' ) + ',1)';
# getting a "cannot call super outside an instance method" error here -
# the resulting code produced does not end up using the super/parent bit
# or at least it doesn't produce bugs in the result if it is not here.
# calling the constructor without super works, and with super the difference is
# ImageTextModePaletteVGA.__super__.constructor.apply(this, arguments);
# is placed inside the constructor. I believe the end result, based on how
# this is used, is identical.
# I am not seeing this pattern (the 'super by itself') being used or referenced
# - instead I am seeting very different patterns using super to reference
# complete items. (referenced meaning "in books, searches, or coffescript
# documentation")
class @ImageTextModePaletteVGA extends @ImageTextModePalette
constructor: (options) ->
@colors = [
[ 0x00, 0x00, 0x00 ],
[ 0x00, 0x00, 0xaa ],
[ 0x00, 0xaa, 0x00 ],
[ 0x00, 0xaa, 0xaa ],
[ 0xaa, 0x00, 0x00 ],
[ 0xaa, 0x00, 0xaa ],
[ 0xaa, 0x55, 0x00 ],
[ 0xaa, 0xaa, 0xaa ],
[ 0x55, 0x55, 0x55 ],
[ 0x55, 0x55, 0xff ],
[ 0x55, 0xff, 0x55 ],
[ 0x55, 0xff, 0xff ],
[ 0xff, 0x55, 0x55 ],
[ 0xff, 0x55, 0xff ],
[ 0xff, 0xff, 0x55 ],
[ 0xff, 0xff, 0xff ]
]
class @ImageTextModePaletteANSI extends @ImageTextModePalette
constructor: (options) ->
@colors = [
[ 0x00, 0x00, 0x00 ],
[ 0xaa, 0x00, 0x00 ],
[ 0x00, 0xaa, 0x00 ],
[ 0xaa, 0x55, 0x00 ],
[ 0x00, 0x00, 0xaa ],
[ 0xaa, 0x00, 0xaa ],
[ 0x00, 0xaa, 0xaa ],
[ 0xaa, 0xaa, 0xaa ],
[ 0x55, 0x55, 0x55 ],
[ 0xff, 0x55, 0x55 ],
[ 0x55, 0xff, 0x55 ],
[ 0xff, 0xff, 0x55 ],
[ 0x55, 0x55, 0xff ],
[ 0xff, 0x55, 0xff ],
[ 0x55, 0xff, 0xff ],
[ 0xff, 0xff, 0xff ]
]