Log In  
Follow
MrScottyTay
[ :: Read More :: ]

Cart #colours-10 | 2024-05-10 | Embed ▽ | License: CC4-BY-NC-SA
15

Colour Reference

A simple and small colour reference utility intended to be ran as a widget, but can still be ran windowed.

Think I'm mostly done with this app now as of v3.0. I have one more idea but I'll probably take a break before doing it and try and move onto something else in the meantime. I have what I want now to help with my development and learned a lot on the way too, hope this app can be useful to you too.

Widget install instructions

To add to your tooltray as a widget add the following line to the /appdata/system/startup.lua

create_process("/filepath/to/Colours.p64",
{
    window_attribs = {workspace = "tooltray", x=0, y=0},
})

change "/filepath/to/Colours.p64" to wherever you save the cart on your system.
I would recommend saving it as /appdata/tooltray/Colours.p64

Customisation

When ran as window the look of the app can be changed via the hamburger menu. To apply the same level of customisation when ran as a widget you can use the following arguments to do so:

  • Chromatic - Change the ordering of the colours to
    be more reminiscent of the editors

  • UseDarkText - Instead of the default way to render
    the text colour on light coloured cells, it will
    use a single darker colour for all light coloured cells.

  • Vertical - Rotates the orientation to be vertical

  • BigFont - use the standard Picotron font rather than
    the smaller Pico 8 font that this app uses by default.

(For the following options, replace # with a number)

  • XSize=# - Specify how wide you want the cells to be.
    Default value is 9, 2 pixels are added when in BigFont
    mode. 9 should be considered the smallest, otherwise
    the font won't align.

  • PaddingSize=# - Specify the extra space in the middle
    'trough' of the palette. Default is 2. When in vertical
    windowed mode, if the overall width of the palette is
    less than 32, the padding will be increased to
    accommodate. This limitation is ignored when used as a
    Widget.

example of create_process command with args:

create_process("/appdata/tooltray/Colours.p64",
{
  window_attribs = {workspace = "tooltray", x=0, y=0},
  argv = {"UseDarkText", "Chromatic" "PaddingSize=4"}
})

The order of the args does not matter

Changelog:

v3.0

  • Added Chromatic ordering that changes the orders of the colours to be more reminiscent of what you see in the editors. This can be changed in the windowed version in the hamburger menu with the Change Ordering option, and can be done for the widget with the Chromatic arg.
  • removed un-needed files from the cart (Actually this time -.-)

v2.3

  • Implemented parsing of args for customising the look of the app when installed as a widget.

v2.2

  • Reimplemented the original default (larger) font version. Changeable via the Change Font option in the hamburger menu.

v2.1

  • Fixed an issue with the padding of the vertical mode persisting when reverting back to horizontal.

v2.0

  • Added Vertical mode - accessed in windowed mode via the Change Orientation option in the hamburger menu. I imagine this will be useful if using a Windowed editor like SLATE rather than the standard fullscreen one.
  • Exposed option to change the way the colours over the light colours are done with the Change Dark Text Style in the hambruger menu (I will make this an arg at some point so it can also be done for when it's a Widget).

v1.3

  • fixed bug where window was still resizeable (thanks OniriCorpe) (somehow this fix wasn't saved to 1.2)

v1.2

  • cleaned up some code, removed previous now unused experiments etc.
  • added comments to code in case people use the code as reference or learning
  • added Widget instructions (same file you can see in cart image) into the cart itself

v1.1

  • Changed the font to the Pico 8 font to slim it down a bunch more.
P#147325 2024-04-25 20:33 ( Edited 2024-05-10 08:07)