Commit graph

24 commits

Author SHA1 Message Date
Emmanuel Lepage Vallee
52c481babc gears.color: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee
86d1b1c22c doc: Add a mandatory @noreturn for functions and methods.
The goal is to catch cases where the return value exists, but is
forgotten. There was a large enough number of them to turn this
into a real check. Initially, I just wanted to implement it to fix
the problems, then delete the code. But since this is so common, I
think it is worth the annoyance.
2022-08-29 22:49:45 -07:00
Emmanuel Lepage Vallee
f6f57e7ba0 gears.color: Add a function to apply the alpha to a color.
Some code in awesome concatenate color strings. This means it blows
up when the pattern are used instead of color, with this, it fails
gracefully (by returning the unmodified pattern).
2022-08-29 22:48:36 -07:00
Emmanuel Lepage Vallee
91fe314e0b gears.color: Fix color serialization.
Some widgets like the tasklist serialize the theme colors to use them
in Pango markup. If the theme color were already converted to pattern,
that blew up. With this fix, pattern can be converted back into strings
correctly.
2022-08-29 22:48:36 -07:00
Pepijn Krijnsen
53b70b4585 Update documentation for gears.color.parse_color(col) method
Lua comments now accurately describe the return values of this method.
Added a more comprehensive example, too. Issue #3555
2022-02-12 21:04:21 +00:00
Yauhen Kirylau
6ef3a8f059
fix(gears: colors: recolor_image): always duplicate the surface (#3233) 2021-03-27 23:48:48 -07:00
Emmanuel Lepage Vallee
b4ece0f053 doc: Use an explicit tag for all static functions.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.

This commit also fixes a large number of issues found while
proof-reading everything.
2019-06-08 18:14:13 -04:00
Emmanuel Lepage Vallee
cdeafeff94 doc: Add a section for theme related libraries 2019-06-08 18:13:42 -04:00
Uli Schlachter
28e8894f05 Give the docs for gears.color some improvements
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-22 11:53:39 +01:00
Uli Schlachter
8cc469322f ensure_pango_color: Support hex values with alpha
Reference: https://github.com/awesomeWM/awesome/pull/2129#discussion_r155397507
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-13 02:15:30 +01:00
Luke Bonham
d3b8088c1b ldoc: fixes in lib/gears/color.lua and objects/client.c 2017-03-12 11:45:41 +01:00
Kevin Zander
0066257a59 Move ensure_pango_color out of awful.util into gears.color
Update deprecated awful.util.ensure_pango_color calls to gears.color.ensure_pango_color calls
2017-03-08 15:28:48 -06:00
MoreThanOneAnimal
6558164e53 Create artificial gears.color documentation.
Point from parse_color function to gears.color in documentation.
Fix minor issues (typos, indentation) in docs.
2016-11-28 20:23:46 -08:00
MoreThanOneAnimal
495e579fdb parse_color function refactoring:
- simplified parsing logic,
- return nil for incorrect input,
- update tests and doc.
2016-11-28 20:22:39 -08:00
Uli Schlachter
259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Emmanuel Lepage Vallee
2aa15c9454 gears.color: Add transparent constant
Avoid repetitive "#00000000" for transparent wiboxes and such
elements.
2016-03-04 03:16:56 -05:00
Uli Schlachter
8c26e2dab4 Fix all luacheck warnings in lib/gears
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-12 09:11:50 +01:00
Uli Schlachter
79d3dc003a gears.color: Add support for named colors
Oh hey, Pango exports an API that allows to query for named colors based on the
famous rgb.txt! Let's use that!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 14:27:29 +01:00
Uli Schlachter
0956aa01d9 Add support for short/long colors
This adds support to gears.color.parse_color to parse things like "#fff" (one
character per color component, without alpha) and "#ffff0000ffff0000" (four
characters per component, with alpha).

This makes sense on its own, but should also help with
https://github.com/awesomeWM/awesome/issues/585.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 14:16:40 +01:00
Daniel Hahler
4bffa7e47e doc: fix unintentional rendering as code due to indent 2015-10-14 00:22:26 +02:00
actionless
e023fd0640 fix(lib: gears: color): use surface for recolor 2015-09-04 21:09:46 +02:00
actionless
2f340f05ff feat(themes: xresources): recolor layout icons 2015-09-04 21:08:18 +02:00
Uli Schlachter
a239b2cac7 Use gears.cache to replace some other caches
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-25 15:08:00 +02:00
Julian Wollrath
6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00
Renamed from lib/gears/color.lua.in (Browse further)