1
0
Fork 0

move colors from draw.nas to api/colors.nas

This commit is contained in:
Henning Stahlke 2020-06-27 23:18:14 +02:00 committed by James Turner
parent c93cf18842
commit 63fc1cf06d
5 changed files with 27 additions and 26 deletions

View file

@ -18,6 +18,7 @@ var include_path = "Nasal/canvas/api/";
# log level for debug output
var _API_dbg_level = DEV_WARN;
io.include(include_path~"colors.nas");
io.include(include_path~"helpers.nas");
io.include(include_path~"transform.nas");
io.include(include_path~"element.nas");

View file

@ -0,0 +1,24 @@
#-------------------------------------------------------------------------------
# colors.nas
#-------------------------------------------------------------------------------
colors = {
black: [0, 0, 0],
white: [1, 1, 1],
grey25: [0.25, 0.25, 0.25],
grey50: [0.5, 0.5, 0.5],
grey75: [0.75, 0.75, 0.75],
red: [1, 0, 0],
green: [0, 1, 0],
blue: [0, 0, 1],
cyan: [0, 1, 1],
magenta: [1, 0, 1],
yellow: [1, 1, 0],
lightblue: [0, 0.5, 1],
purple: [0.5, 0, 1],
orange: [1, 0.5, 0],
amber: [1, 0.682, 0],
};

View file

@ -141,20 +141,6 @@ var draw = {
#aliases
draw.diamond = draw.rhombus;
draw.colors = {
white: [1, 1, 1],
grey50: [0.5, 0.5, 0.5],
grey25: [0.25, 0.25, 0.25],
black: [0, 0, 0],
red: [1, 0, 0],
green: [0, 1, 0],
blue: [0, 0, 1],
cyan: [0, 1, 1],
magenta: [1, 0, 1],
yellow: [1, 1, 0],
orange: [1, 0.5, 0],
};
#base class for styles
draw.style = {
new: func() {

View file

@ -33,7 +33,7 @@ var EFISCanvas = {
me._timers = [];
},
colors: EFIS.colors,
colors: canvas.colors,
defaultcanvas_settings: EFIS.defaultcanvas_settings,
new: func(name, svgfile=nil) {

View file

@ -27,17 +27,7 @@ var EFIS = {
window_size: [450,450],
colors: {
transparent: [1,0,0,0],
white: [1,1,1],
red: [1,0,0],
green : [0,1,0],
blue : [0,0,1],
yellow: [1,1,0],
cyan: [0,1,1],
magenta: [1,0,1],
amber: [1,0.682,0],
},
colors: canvas.colors,
del: func() {
},