Audulus-Canvas Libraries v0.0.1-alpha
- -Libraries
-color | -Functions and tables that create, translate, validate, and manipulate colors. | -
debug | -Useful debugging functions. | -
diff --git a/build_library.sh b/build_library.sh index f283f09..6291c87 100755 --- a/build_library.sh +++ b/build_library.sh @@ -1,4 +1,16 @@ #!/bin/zsh -# Concatenate all Lua files in the current directory into one +# Concatenate all Lua files in the current directory into one except for builtins. -find . -name '*.lua' -not -name 'library.lua' -exec sh -c 'cat {} && echo && echo' \; > library.lua \ No newline at end of file +temp_file="temp_library.lua" + +# Add the top content +echo "-- SCROLL TO BOTTOM ----------------------------------------------------\n" > "$temp_file" + +# Concatenate the Lua files +find . -name '*.lua' -not -name 'library.lua' -not -name 'builtins.lua' -not -name 'temp_library.lua' -exec sh -c 'cat {} && echo && echo' \; >> "$temp_file" + +# Add the bottom content +echo -e "-- AUDULUS-CANVAS LIBRARY ----------------------------------------------\n\n----- Instructions -----\n-- 1. Create 'Time' input (case-sensitive)\n-- 2. Attach Timer node to the 'Time' input\n-- 3. Select 'Save Data' at the bottom of the inspector panel\n-- 4. Set a custom W(idth) and H(eight) in the inspector panel\n-- 5. Write your code below this line\n\n-- CODE ----------------------------------------------------------------\n\n\n\n\n\n-- PRINT CONSOLE -------------------------------------------------------\n\nprint_all()" >> "$temp_file" + +# Rename the temporary file to library.lua +mv "$temp_file" "library.lua" diff --git a/config.ld b/config.ld deleted file mode 100644 index e69de29..0000000 diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index 245b534..0000000 --- a/doc/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - -
-color.color
color library.
-- This is the main module for color-related functionalities. - It encapsulates submodules like color.convert, color.tables, and color.validate.
- - - -color.convert
Functions to convert various color types into one another
- - - -hex_code_to_color (s) | -Converts a hex code string to a color table. | -
color
Functions and tables that create, translate, validate, and manipulate colors.
-- This is the main module for color-related functionalities. - It encapsulates submodules like color.convert, color.tables, and color.validate.
- - -hex_code_to_color (s) | -Converts a hex code string to a color table. | -
htmlColors | -All of the named HTML colors. | -
is_valid_hex_code (s) | -Checks if a CSS hex code is formatted properly. | -
white = hex_code_to_color("#FFF") -print(white) -- {1, 1, 1, 1} - -black = hex_code_to_color("000F") -print(black) -- {0, 0, 0, 1} - -orange = hex_code_to_color("#FFA500") -print(orange) -- {0.9450..., 0.7686..., 0.0588..., 1} - -blue_transparent = hex_code_to_color("0000FF33") -print(blue_transparent) -- {0, 0, 1, 0.2} - -malformed_hex = hex_code_to_color("#G09F3") --- ValueError: Not a valid hex code.- - -
print(is_valid_hex_code(FFF)) -- true - -print(is_valid_hex_code(#J37N)) -- false- - -
color.tables
Tables of colors
- - - -htmlColors | -All of the named HTML colors. | -
color.validate
Functions to validate the form of color strings and numbers
- - - -isValidHexCode (s) | -Checks if a CSS hex code is formatted properly. | -
debug
Useful debugging functions.
- - - -create_print_logger () | -Returns a set of functions that together enable stdout-like printing. | -
print, printAll = create_print_logger() - -x = 1 + 1 -print(x) - -color = {0.5, 0.75, 0.1, 1} -print(color) - -coordinate = {x = 1, y = 12} -print(coordinate) - -printAll() --- (Note: This appears below the Canvas node) -- --- Memory usage (KB): 72 --- Print Queue Output --- _________________ --- 1. 2 --- 2. {0.5, 0.75, 0.1, 1} --- 3. {x = 1, y = 12}- - -