Commit Graph

25 Commits

Author SHA1 Message Date
Ian McInerney 920120864f Fix initialization of COLOR4D statics
Just declaring as static const would give an initialization order
fiasco since they were being used to initialize other statics.
2019-08-06 10:06:10 -07:00
Jeff Young 7553cc2651 Clean up some dangling legacy odds and ends. 2019-06-01 01:17:46 +01:00
Seth Hillbrand 7b3ef1b7ed colors: Add HSL conversion and tune colors
When adding colors to length tuner, we depend on the window background
color, which can be set by the user, resulting in an unreadable text.
This uses the HSL conversion to detect which shade it should use for the
coloring.

Also adds test cases for round-trip HSL and HSV conversion

Fixes: lp:1814530
* https://bugs.launchpad.net/kicad/+bug/1814530
2019-02-11 22:08:41 -08:00
John Beard 4c355c32d3 Fix rounding in COLOR4D::ToColour
Due to the implicit floor of the cast from double to unsigned char,
there was a small rounding error in COLOUR4D's WX conversion function.

This fixes the failing tests.

Also make the cast to unsigned char explicit.
2018-11-08 14:40:42 -05:00
jean-pierre charras 0dfd0c5f52 Minot cosmetic enhancement 2018-10-11 11:26:59 +02:00
Ronnie Gaensli ab1f016132 Fix assert freeze of eeschema when ToHSV, h is Nan
Fixes: lp:1797006
* https://bugs.launchpad.net/kicad/+bug/1797006
2018-10-10 21:22:26 +02:00
Jeff Young 99e659ff54 Coverity fixes. 2018-03-21 23:11:55 +00:00
Jon Evans 0564d3456b Preserve color scheme when switching to legacy (Fixes lp:1670669)
Instead of modifying the colors when switching to legacy canvas,
they will now be preserved and only returned as the "legacy" colors.
2017-11-28 10:47:04 +01:00
jean-pierre charras 5f4599fb56 Add a new color selector, to adjust color selection for GAL mode, with support of opacity (alpha channel)
Pcbnew: save opacity value in color config, and keep it when switching between legacy and gal mode.
2017-07-18 19:07:47 +02:00
jean-pierre charras ed66496242 Fix an issue (created by commit 16cb6a6ca0) when converting a color4D to a legacy color
Fixes: lp:1704724
https://bugs.launchpad.net/kicad/+bug/1704724
2017-07-17 09:59:34 +02:00
jean-pierre charras 16cb6a6ca0 color4d: fix incorrect conversion from rgb to HSV when r = g = b. 2017-07-16 17:10:24 +02:00
Jon Evans 8cd1df0524 Add output stream operator for COLOR4D 2017-03-31 06:48:04 -04:00
jean-pierre charras 04d1b2fca7 fix incorrect COLOR4D::COLOR4D( EDA_COLOR_T aColor ) ctor for UNDEFINED_COLOR 2017-02-23 18:17:47 +01:00
jean-pierre charras 2f24b31b28 simplify color calculation. 2017-02-23 17:55:55 +01:00
jean-pierre charras 1f345052cd Fix erroneous conversion between wxColor and COLOR4D 2017-02-23 14:30:43 +01:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Maciej Suminski 0ac3e1fbf2 Namespace KiGfx->KIGFX.
template<> -> template <>
Some more reformatting according to uncrustify results.
2013-10-14 16:13:35 +02:00
Maciej Suminski 22045b61ea Converted tabs to spaces. Removed trailing whitespaces. 2013-10-14 13:43:57 +02:00
Maciej Suminski 82fe1a4972 Merged Tom's branch 2013-09-12 17:42:28 +02:00
tomasz.wlostowski@cern.ch c3759d870c COLOR4D: added Saturate(), FromHSV(), ToHSV() methods.
Used in highlighting/routing code.
2013-09-12 11:35:42 +02:00
Maciej Suminski 7d4aed1099 Fixed COLOR4D( EDA_COLOR_T aColor ) and added asserts. 2013-09-11 10:30:39 +02:00
Maciej Suminski 81c674387e Added convertsion from wxColour to COLOR4D. 2013-06-24 10:32:08 +02:00
Maciej Suminski f7d85691c2 Added conversion from EDA_COLOR_T to COLOR4D. 2013-06-24 10:12:36 +02:00
Maciej Suminski ad4bf38e7a Added class COLOR4D that contains color representation with 4 components (RGBA) (for future usage in GAL) 2013-03-28 17:42:15 +01:00