Colours - General Help and Assistance on using CHDK stable releases - CHDK Forum

Colours

  • 12 Replies
  • 957 Views
Colours
« on: 26 / May / 2021, 17:47:38 »
Advertisements
@reyalp

Would you be receptive to a request to add two additional colours to the CHDK library, eg transparent_black and %_gray

These are available over in ML and are really useful to access.

https://builds.magiclantern.fm/lua_api/modules/constants.html

*

Offline reyalp

  • ******
  • 13387
Re: Colours
« Reply #1 on: 26 / May / 2021, 18:31:02 »
Would you be receptive to a request to add two additional colours to the CHDK library,
In what context? Script drawing?
Quote
eg transparent_black and %_gray
I'm not clear what specific values these would be.

You can see the "known" CHDK colors in the "CHDK settings->color settings->CHDK Color test". How closely the displayed color matches the description varies widely by port.

Adding additional standard colors is non-trivial, because we have ~160 platforms, and both the Canon palette and CHDK code vary widely per platform. For most ports, CHDK colors either rely on finding something close to the desired color in the Canon palettes, or finding colors that are not used in the normal UI so CHDK can override them.

I would not be enthusiastic about touching this unless there is some path to simplifying or automating it. In principle, the stock Canon colors could be identified from firmware dumps, which might offer a path to automating some of it. This isn't something I'd personally want to put a lot of time into, but if someone else wants to do it, it would be welcome.

Digic 6 and later have a full color UI, so in principle, could allow drawing arbitrary colors, or be given access to a wider range of "standard" colors. I'm not averse to exposing either of those to script if there's a reasonably clean way to do it.
Don't forget what the H stands for.

Re: Colours
« Reply #2 on: 27 / May / 2021, 01:33:11 »
@reyalp

Yes it would have been for scripting. For example, the ML example attached shows the transparent_black being used in the top and bottom info bars, allowing you to see the image underneath.

I hadn’t appreciated how difficult it would be to implement.

Cheers

Garry


*

Offline reyalp

  • ******
  • 13387
Re: Colours
« Reply #3 on: 27 / May / 2021, 02:17:30 »
Note if you aren't concerned about portability, you should be able to use 0-255 to draw the any of the colors visible in "CHDK Settings -> Color settings -> Draw palette" with Lua drawing.

On pre-digic 6 cameras, that is the Canon palette.

I hadn't actually paid attention to how these colors work for digic 6 and later where we don't use the Canon palette, but it looks for 1.5 and trunk, it's an arbitrary selection of colors calculated from the index value, while in the xmir branch, it's currently just the CHDK colors.
Don't forget what the H stands for.


*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: Colours
« Reply #4 on: 27 / May / 2021, 02:22:09 »
Yes it would have been for scripting. For example, the ML example attached shows the transparent_black being used in the top and bottom info bars, allowing you to see the image underneath.


@pigeonhill


CHDK has a transparent grey script color.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Colours
« Reply #5 on: 27 / May / 2021, 02:42:10 »
Quote
CHDK has a transparent grey script color.

Shock-horror!

I’ll have to look more closely.

Cheers

Garry

Re: Colours
« Reply #6 on: 27 / May / 2021, 02:44:49 »
@philmoz

Quote

https://chdk.fandom.com/wiki/Lua/Drawings#Colors


Transparent grey doesn’t seem to appear in the list on the above page. 

Re: Colours
« Reply #7 on: 27 / May / 2021, 03:50:25 »
Got it  :)

At least 18 works.

EDIT

So does 50, 82, 114, 146, 178, 210 & 242

« Last Edit: 27 / May / 2021, 04:10:50 by pigeonhill »


Re: Colours
« Reply #8 on: 27 / May / 2021, 04:29:09 »
@philmoz

'Just' reporting ;-)

Not sure why and it may mean something to you.

In the M3, LCD drawing the transparent_gray works a treat.

In EVF mode I can see the transparent_gray is working in the recf drawing, but what I see is that any text I draw seems to create a black background fill across the entire screen. I can see this, as the background transparent_gray recf is bigger than the text height.

I'm convinced it's not my code, as in the LCD it's fine.

I can't get a screen grab to show you.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: Colours
« Reply #9 on: 27 / May / 2021, 04:38:57 »
In EVF mode I can see the transparent_gray is working in the recf drawing, but what I see is that any text I draw seems to create a black background fill across the entire screen. I can see this, as the background transparent_gray recf is bigger than the text height.

I'm convinced it's not my code, as in the LCD it's fine.

I can't get a screen grab to show you.


@pigeonhill


chdkptp is the best way to capture screen shots in all modes.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics