From 98ee37719d432d542797634dc7eb2873f64055ce Mon Sep 17 00:00:00 2001 From: Erlend <49862976+Erb3@users.noreply.github.com> Date: Wed, 17 May 2023 20:09:59 +0200 Subject: [PATCH] Improve documentation for colors.fromBlit and colors.toBlit --- .../data/computercraft/lua/rom/apis/colors.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/colors.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/colors.lua index 99621f933..388b087e1 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/colors.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/colors.lua @@ -357,6 +357,12 @@ end -- -- @tparam number color The color to convert. -- @treturn string The blit hex code of the color. +-- @usage +-- ```lua +-- colors.toBlit(colors.red) +-- -- => "c" +-- ``` +-- @see colors.fromBlit -- @since 1.94.0 function toBlit(color) expect(1, color, "number") @@ -370,6 +376,13 @@ end -- -- @tparam string hex The paint/blit hex character to convert -- @treturn number The color +-- @usage +-- ```lua +-- colors.fromBlit("e") +-- -- => 16384 +-- ``` +-- @see colors.toBlit +-- @since 1.105.0 function fromBlit(hex) expect(1, hex, "string")