Wikia

CHDK Wiki

Palette

Talk0
572pages on
this wiki

Palette refers to the color selections available on a given camera, in a given user interface context.  These affect how CHDK menus and OSD elements - including user Grids - are displayed.

This page is mainly for end-users working to create their own Grids.  For developer information, see: Frame buffers

PalettesEdit

The CHDK programming defines 17 different palettes As of February 2013[update] used across various camera models and references these palettes internally to draw menus and OSD elements using appropriate colors.

Grids, however, cannot use these internal references and require a direct palette entry reference.  Because these palettes can vary between camera models, user interface contexts (record vs playback, for example), creating a Grid well-suited to a specific camera is greatly eased by seeing the palette for that camera and mode.

CHDK 'Draw Palette'Edit

The simplest method to see the palette used by a camera is through CHDK itself through its 'Draw Palette' option:

Chdk-drawpalette

Draw Palette (CHDK 1.1.0-2511)

  1. Access the CHDK menu.
  2. Choose "Miscellaneous Stuff"
  3. Choose "Draw Palette"

This will draw a grid of palette colors (shown for SX260 HS, playback mode):

The "Color: 0x00" changes as you use your camera's navigation buttons to move to other palette entries.  You can use the indicated value (0x00 through 0xff) directly in Grids and drawing commands.

Palette SheetsEdit

Alternatively, you can check if the CHDK wikia entry for the target camera has a Palette Sheet listed.  Palette sheets are created from screen captures and a bit of editing.  This also makes it easier to design a Grid on a computer before transferring it to the camera.


Palette-template

Palette Sheet template

The basic Palette Sheet consists of a title with the camera's model name and mode, columns and rows indicating decimal and hexadecimal indices for a given palette entry, and the palette for the given camera model and mode.

A template is presented here. ( Note: The template contains transparency information, open the file directly rather than copying it, as this information is usually lost. )

'Right click, Save' to download template



Creating Palette SheetsEdit

To create a Palette Sheet:

  1. Take a screen capture of your camera's Palette at 1:1 without stretching.
  2. Use drawing tools to remove the currently selected palette entry's zoomed state, or take another screen capture with a different cell selected, combining the two captures.
  3. Select only the Palette grid.
  4. Copy the selection.
  5. Paste into the template at the appropriate location.
  6. Adjust the title to include your camera model, and mode.  Suggested mode names: record, playback, menu, set.  The font used in the template is Segoe UI, but is not of particular importance.
  7. Optional: Because transparent colors can be difficult to visualize on the web, outline transparent cells with a pure green color.
  8. Optional: Because CHDK partially overrides the palette on some camera models, you can outline the affected cells with a pure yellow color.  You can check the source code, platform/yourcameramodel/platform_camera.h for CAM_LOAD_CUSTOM_COLORS.  If this is defined as 1, look for CHDK_COLOR_BASE.  Its value indicates where the camera's CHDK profile will be inserting its own colors, typically 13 in total (red, dark red, light red, green, dark green, light green, blue, dark blue, cyan, magenta, yellow, dark yellow and light yellow) but for exact details of replaced entries, see platform/yourcameramodel/lib.c and look for load_chdk_palette
  9. Save, or Export, the result as a PNG file, making sure that transparency information is retained.
Palettesheet-sx260hs-playback

Palette Sheet for Canon SX260 HS - playback mode

You should then end up with a Palette Sheet something like the example shown here. 

Double-check whether your camera uses different palettes in different modes and create additional Palette Sheets if warranted.  Often at least record and playback use different palettes, but additional palettes may be used when in the menu or using set

Around Wikia's network

Random Wiki