Re: [gpick] Hex representation operation

6 views
Skip to first unread message

Albertas Vyšniauskas

unread,
Feb 28, 2013, 1:21:09 PM2/28/13
to gp...@googlegroups.com
On 02/26/2013 11:02 PM, ha...@midgard.by wrote:
> 1. Copying color on not only to clipboard wich used for C-c C-v
> operations but also to one which used when selecting text with mouse
> and pasting it with middleclick. I use it a lot, particulary problems
> appears when I try to past color copied from gpick to terminal in
> vwhich C-v to past doesn't work at all. It may be added to preferences.
> 2. Also add into preferences possibility to select whether hex-form
> must consist of numbers and letters in upper or in lower case. Because
> personally me and number of my friends strongly prefer lower-case
> letters in hex-numbers.
Hi,

Both requests make sense, I will look into it.

Currently you can get lowercase hex codes by changing share/gpick/init.lua.
Change this:

gpick.serialize_web_hex = function (color_object)
local c = color_object:get_color()
return '#' .. string.format('%02X%02X%02X', round(c:red()*255),
round(c:green()*255), round(c:blue()*255))
end

to this:

gpick.serialize_web_hex = function (color_object)
local c = color_object:get_color()
return '#' .. string.format('%02x%02x%02x', round(c:red()*255),
round(c:green()*255), round(c:blue()*255))
end


Regards
Albertas Vy�niauskas
Reply all
Reply to author
Forward
0 new messages