Project

General

Profile

Actions

Feature #1900

open

HTML5 Color Picker

Added by Anonymous almost 11 years ago. Updated almost 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/08/2013
Due date:
% Done:

0%

Estimated time:

Description

HTML5 supports a new widget exclusively for color picking, via the "color" input that would be incredibly useful in WT. Sadly, it's only supported in HTML5 and in Chrome and Opera.

LUCKILY, the one used in Chrome/WebKit is based entirely off of a javascript polyfill known as Spectrum, which is compatible back to IE 6, requires no images or fancy tricks, is licensed appropriate for commercial use, and has a large amount of javascript hooks to boot. It's also rather small, though I'm sure you'll probably want to strip out some of the CSS and WT it (though it could probably be used as is with minimal effort).

I understand other things are probably higher priority, but this sort of widget is incredibly useful and furthers WT's HTML5 integration.

Spectrum: http://bgrins.github.io/spectrum/

Actions #1

Updated by Wim Dumon almost 11 years ago

Without trying if it really works, It may work if you load the css and js of spectrum (WApplication::addStyleSheet and WApplication::require), and then call setAttribute on a WLineEdit to set the type to color?

Chrome pops up the color picker if I add this line to hello.C:

nameEdit_->setAttributeValue("type", "color");

Wim.

Actions

Also available in: Atom PDF