Support RGB8 colour specifications

Registered by Paul "LeoNerd" Evans on 2015-01-23

The API of TickitPen was carefully designed to allow the two colour attributes to be specified in a multitude of forms. One such form would be a { uint8_t r, g, b } triplet, for those terminals that support the SGR 38:2:r:g:b scheme.

There are some questions though, namely:
  * Try to detect from the terminal driver if RGB8 is going to be supported
  * On the (frankly, likely) chance that it isn't, how to handle this? Should the library try to translate to "nearest 256", like it downsamples 256 to 16 or 8-colour palettes?
  * What happens if you set a pen colour using either RGB8 or xterm256 models and then try to query its value via the other?

Blueprint information

Status:
Complete
Approver:
Paul "LeoNerd" Evans
Priority:
Low
Drafter:
Paul "LeoNerd" Evans
Direction:
Approved
Assignee:
None
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Implemented
Milestone target:
milestone icon v0.2
Started by
Paul "LeoNerd" Evans on 2017-12-02
Completed by
Paul "LeoNerd" Evans on 2017-12-02

Related branches

Sprints

Whiteboard

<LeoNerd> http://bazaar.launchpad.net/~leonerd/libtickit/trunk/view/head:/src/pen.c#L12 <== add some RGB8 values here (maybe 2x3 uint8_t fields)
<LeoNerd> Need more 'valid' bits
<LeoNerd> http://bazaar.launchpad.net/~leonerd/libtickit/trunk/view/head:/src/pen.c#L254 <== add some 'colour_rgb8' or somesuch
<LeoNerd> http://bazaar.launchpad.net/~leonerd/libtickit/trunk/view/head:/src/termdriver-xterm.c#L228 <== will need some work to account for it
<LeoNerd> Also the '12' above now needs to become 16
<LeoNerd> I suspect for a first cut that should be it. Enough to prove a PoC. Additionally the non-xterm driver will want some workaround for what to do if there is RGB8 set on the pen.. how to handle that down to the 256/88/16/8 colour palette

---

Started writing some code, putting them in totally unrelated attributes called FG_RGB8 and BG_RGB8. Further thought needs to be had on whether that's really the best way, or whether merging them together might be nicer. Need to decide how to handle "fallback" - setting both RGB8 and 256 index at once.

(?)

Work Items

Work items:
code: INPROGRESS
tests: TODO
docs: TODO
xterm driver: TODO
TI driver: TODO

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.