diff --git a/doc/styles.css b/doc/styles.css index 2bcc830cc..da9fbec6a 100644 --- a/doc/styles.css +++ b/doc/styles.css @@ -111,7 +111,7 @@ footer { } /* The definition lists at the top of each page */ -table.definition-list { +table.definition-list, table.pretty-table { border-collapse: collapse; width: 100%; } @@ -130,6 +130,16 @@ table.definition-list th { table.definition-list td { width: 100%; } +/* Pretty tables, mostly inherited from table.definition-list */ +table.pretty-table td, table.pretty-table th { + border: 1px solid #cccccc; + padding: 2px 4px; +} + +table.pretty-table th { + background-color: #f0f0f0; +} + dl.definition dt { border-top: 1px solid #ccc; padding-top: 1em; diff --git a/src/main/resources/data/computercraft/lua/rom/apis/colors.lua b/src/main/resources/data/computercraft/lua/rom/apis/colors.lua index a941fa287..1edb47bce 100644 --- a/src/main/resources/data/computercraft/lua/rom/apis/colors.lua +++ b/src/main/resources/data/computercraft/lua/rom/apis/colors.lua @@ -1,15 +1,137 @@ ---- The Colors API allows you to manipulate sets of colors. --- --- This is useful in conjunction with Bundled Cables from the RedPower mod, --- RedNet Cables from the MineFactory Reloaded mod, and colors on Advanced --- Computers and Advanced Monitors. --- --- For the non-American English version just replace @{colors} with @{colours} --- and it will use the other API, colours which is exactly the same, except in --- British English (e.g. @{colors.gray} is spelt @{colours.grey}). --- --- @see colours --- @module colors +--[[- The Colors API allows you to manipulate sets of colors. + +This is useful in conjunction with Bundled Cables from the RedPower mod, RedNet +Cables from the MineFactory Reloaded mod, and colors on Advanced Computers and +Advanced Monitors. + +For the non-American English version just replace @{colors} with @{colours} and +it will use the other API, colours which is exactly the same, except in British +English (e.g. @{colors.gray} is spelt @{colours.grey}). + +On basic terminals (such as the Computer and Monitor), all the colors are +converted to grayscale. This means you can still use all 16 colors on the +screen, but they will appear as the nearest tint of gray. You can check if a +terminal supports color by using the function @{term.isColor}. + +Grayscale colors are calculated by taking the average of the three components, +i.e. `(red + green + blue) / 3`. + +
Default Colors | |||||||
---|---|---|---|---|---|---|---|
Color | +Value | +Default Palette Color | +|||||
Dec | Hex | Paint/Blit | +Preview | Hex | RGB | Grayscale | +|
colors.white |
+ 1 | 0x1 | 0 | +#F0F0F0 | 240, 240, 240 | ++ | |
colors.orange |
+ 2 | 0x2 | 1 | +#F2B233 | 242, 178, 51 | ++ | |
colors.magenta |
+ 4 | 0x4 | 2 | +#E57FD8 | 229, 127, 216 | ++ | |
colors.lightBlue |
+ 8 | 0x8 | 3 | +#99B2F2 | 153, 178, 242 | ++ | |
colors.yellow |
+ 16 | 0x10 | 4 | +#DEDE6C | 222, 222, 108 | ++ | |
colors.lime |
+ 32 | 0x20 | 5 | +#7FCC19 | 127, 204, 25 | ++ | |
colors.pink |
+ 64 | 0x40 | 6 | +#F2B2CC | 242, 178, 204 | ++ | |
colors.gray |
+ 128 | 0x80 | 7 | +#4C4C4C | 76, 76, 76 | ++ | |
colors.lightGray |
+ 256 | 0x100 | 8 | +#999999 | 153, 153, 153 | ++ | |
colors.cyan |
+ 512 | 0x200 | 9 | +#4C99B2 | 76, 153, 178 | ++ | |
colors.purple |
+ 1024 | 0x400 | a | +#B266E5 | 178, 102, 229 | ++ | |
colors.blue |
+ 2048 | 0x800 | b | +#3366CC | 51, 102, 204 | ++ | |
colors.brown |
+ 4096 | 0x1000 | c | +#7F664C | 127, 102, 76 | ++ | |
colors.green |
+ 8192 | 0x2000 | d | +#57A64E | 87, 166, 78 | ++ | |
colors.red |
+ 16384 | 0x4000 | e | +#CC4C4C | 204, 76, 76 | ++ | |
colors.black |
+ 32768 | 0x8000 | f | +#111111 | 17, 17, 17 | ++ |