Up to [cvs.NetBSD.org] / pkgsrc / graphics / ruby-color
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
graphics/ruby-color: update to 2.2.0
2.2.0 (2026-01-22)
* When color/rgb/colors is loaded and the RGB color does not have defined
names, a fallback lookup to named RGB colors will be performed to use that
name.
simple_black = Color.from_values(r: 0, g: 0, b: 0)
stuart_black = Color.from_values(r: 0, g: 0, b: 0, names: ["semple-black-4.0"])
simple_black.name # => nil
stuart_black.name # => "semple-black-4.0"
require 'color/rgb/colors'
simple_black.name # => "black"
stuart_black.name # => "semple-black-4.0"
This was suggested by @akicho8 in #89.
* The RGB inspect and pretty print formats have been modified to include
defined names. This was suggested by @akicho8 in #89.
* Added unit tests for #pretty_print implementations. Fixed some bugs found
in the implementations.
graphics/ruby-color: update to 2.1.2 2.1.2 (2025-12-30) * Updated to Contributor Covenant 3.0 and applied updates to several support documents. * Full coverage of conversion tests. Adds CIELAB to_yiq and Grayscale to_xyz methods. Only YIQ now lacks conversions support. Fixed in #69. * Fix an incorrect conversion of CIELAB colors with low lightness to XYZ, which caused the Y component to be ~903 times larger than correct. In practice, this returned unexpectedly bright colours. This also affected conversion from CIELAB to RGB, CMYK, HSL, YIQ, and grayscale, which convert from CIELAB to XYZ as an intermediate step. Reported by @alexwlchan in #95 and fixed in #96. * Fix an incorrect comparison when converting CIE XYZ colors to RGB that could raise a NoMethodError when constructing the RGB value. The conversion incorrectly compared the absolute value of an intermediate value against the 0.0031308 threshold instead of comparing the original value, causing certain negative values to follow the wrong branch and return complex RGB components. This also affected conversion from XYZ to CMYK, HSL, and YIK, and from CIELAB to RGB, HSL, YIQ, and Grayscale -- all of which convert from XYZ to RGB as an intermediate step. Reported by @alexwlchan in #92 and fixed in #93.
graphics/ruby-color: update to 2.1.1 2.1.1 (2025-08-08) Color 2.1.1 fixes a bug where Color::RGB::Black and Color::RGB::White are no longer defined automatically because they are part of color/rgb/colors. Internally, this defines Color::RGB::Black000 and Color::RGB::WhiteFFF.
graphics/ruby-color: update to 2.1.0 2.0.0 (2025-07-05) Color 2.0.0 is a major release of the Color library. Breaking Changes Color 2.0 contains breaking changes. Functionality previously deprecated has been removed, but other functionality has been changed or removed as part of this release without prior warning. * The minimum supported version of Ruby is 3.2. * Color classes are now immutable implementations of Data objects (first introduced in Ruby 3.2). This will restrict Color 2 from running on versions of JRuby before JRuby 10. * The constants Color::COLOR_VERSION and Color::COLOR_TOOLS_VERSION have been removed; there is only Color::VERSION. This reverses a planned deprecation decision made more than ten years ago that no longer makes sense. * All named color classes at Color have been removed as planned. * Color::RGB::BeccaPurple has been removed as an alias for Color::RGB::RebeccaPurple. * The pseudo-constructor Color.new has been removed. * Color class constructors no longer yield the constructed color if a block is passed. * Renamed Color::COLOR_EPSILON and Color::COLOR_TOLERANCE to Color::EPSILON and Color::TOLERANCE. These aren't private constants because they need to be accessed throughout Color, but they are internal constants that should not be used outside of the Color library or functions exposed therein. * PDF format functions #pdf_fill and #pdf_stroke have been removed from Color::CMYK, Color::Grayscale, and Color::RGB. The supporting internal constants Color::<class>::PDF_FORMAT_STR have also been removed. * Palette processing classes, Color::Palette::AdobeColor, Color::Palette::Gimp, and Color::Palette::MonoContrast have been removed. Persons interested in using these are encouraged to extract them from Color 1.8 and adapt them to use Color 2.0 APIs. * CSS methods (#css_rgb, #css_rgba, #css_hsl, #css_hsla) have been replaced with #css on color classes that have CSS representations. The output of #css differs (Color 1.8 used the legacy CSS color formats; Color 2.0 uses modern CSS color formats). * Color::GrayScale has been renamed to Color::Grayscale. The alias constant Color::GreyScale has been removed. * The #html method has been removed from all color classes except Color::RGB. * Named RGB colors are no longer defined automatically, but must be loaded explicitly by requiring color/rgb/colors. This resolves #30. The use of Color::RGB#extract_colors, Color::RGB.by_hex, Color::RGB.by_name, or Color::RGB.by_css will require color/rgb/colors automatically as they require the presence of the named colors. * Color:CSS#[] has been removed, as has the containing namespace. It has always been a shallow wrapper around Color::RGB.by_name. New Features * Color::CIELAB and Color::XYZ namespaces have been added. Separate implementations were submitted by David Heitzman and @stiff (in #8 and #11), but I have reworked the code substantially. These implementations were originally as Color::LAB and include a new contrast calculation using the ΔE*00 algorithm. Internal * Updated project structure for how I manage Ruby libraries in 2025. This includes increased release security (MFA is required for all releases, automated releases are enabled), full GitHub Actions, Dependabot, Standard Ruby, and more. * Charles Nutter re-added JRuby support in CI. #36 Governance Color 2.0 and later requires that all contributions be signed-off attesting that the developer created the change and has the appropriate permissions or ownership to contribute it to this project under the licence terms.
Update ruby-color to 1.8.
== 1.8 / 2015-10-26
* 1 minor enhancement:
* Add an optional +alpha+ parameter to all #css_rgba calls. Thanks to Luke
Bennellick (@bennell) and Alexander Popov (@AlexWayfer) for independently
implemented submissions. Merged from #15.
* 2 minor bug fixes:
* Improve constant detection to prevent incorrectly identified name
collisions with various other libraries such as Azure deployment tools.
Based on work by Matthew Draper (@matthewd) in #24.
* Prevent Color.equivalent? comparisons from using non-Color types for
comparison. Fix provided by Benjamin Guest (@bguest) in #18.
* 1 governance change
* This project now has a {Code of Conduct}[Code-of-Conduct_rdoc.html]
Update HOMEPAGE. Avoid using rubyforge.org since it stopped most of services.
Update ruby-color to 1.7.1.
== 1.7.1 / 2014-06-12
* Minor enhancements:
* Renamed Color::RGB::BeccaPurple to Color::RGB::RebeccaPurple as stipulated
by Eric Meyer. http://meyerweb.com/eric/thoughts/2014/06/19/rebeccapurple/
For purposes of backwards compatibility, the previous name is still
permitted, but its use is strongly discouraged, and it will be removed in
the Color 2.0 release.
== 1.7 / 2014-06-12
* Minor enhancements:
* Added Color::RGB::BeccaPurple (#663399) in honour of Rebecca Meyer, the
daughter of Eric Meyer, who passed away on the 7th of June, 2014. Her
favourite colour was purple. #663399becca
https://twitter.com/meyerweb/status/476089708674428929
http://www.zeldman.com/2014/06/10/the-color-purple/
http://discourse.specifiction.org/t/name-663399-becca-purple-in-css4-color/225
* Bug fixes:
* Changed the homepage in the gem to point to github.com instead of
RubyForge, which has been shut down. Fixes #10, reported by @voxik.
== 1.6 / 2014-05-19
* Major enhancements:
* Aaron Hill (@armahillo) implemented the CIE Delta E 94 method by which an
RGB colour can be asked for the closest matching colour from a list of
provided colours. Fixes #5.
* To implement #closest_match and #delta_e94, conversion methods for sRGB to
XYZ and XYZ to L*a*b* space were implemented. These should be considered
experimental.
* Tooling fixes:
* Ensured that the gem manifest was up-to-date. Fixes #4 reported by @boutil.
Thanks!
* Fixed problems with Travis builds. Note that Ruby 1.9.2 is no longer
tested. Rubinius remains in a “failure-tolerated” mode.
* Color 1.6 is, barring security patches, the last release of Color that will
support Ruby 1.8.
Update ruby-color to 1.5.1.
== 1.5.1 / 2014-01-28
* color 1.5 was a yanked release.
* Minor enhancements:
* Added new methods to Color::RGB to make it so that the default defined
colours can be looked up by hex, name, or both.
* Added a method to Color::RGB to extract colours from text by hex, name, or
both.
* Added new common methods for colour names. Converted colours do not retain
names.
* Restructured color comparisons to use protocols instead of custom
implementations. This makes it easier to implement new colour classes. To
make this work, color classes should +include+ Color only need to implement
<tt>#coerce(other)</tt>, <tt>#to_a</tt>, and supported conversion methods
(e.g., <tt>#to_rgb</tt>).
* Added @daveheitzman’s initial implementation of an RGB contrast method as
an extension file: <tt>require 'color/rgb/contrast'</tt>. This method and
the value it returns should be considered experimental; it requires further
examination to ensure that the results produced are consistent with the
contrast comparisons used in Color::Palette::MonoContrast.
* Reducing duplicated code.
* Bug Fixes:
* Moved +lib/color/rgb-colors.rb+ to +lib/color/rgb/colors.rb+. This should
have no impact in general.
* Improved the way that named colors are specified internally.
* Fixed bugs with Ruby 1.8.7 that may have been introduced in color 1.4.2.
* Tooling Changes:
* Added simplecov for test coverage analysis.
* Modernized Travis CI support.
update ruby-color to 1.4.2. == 1.4.2 / 2013-06-30 Maintenance: * Modernized Hoe installation of Color, removing some dependencies. * Switched to Minitest. * Turned on Travis CI. * Started using Code Climate. * Small code formatting cleanup that touched pretty much every file.
ruby-color version 1.4.1 dosen't have runtime dependency to devel/hoe and archivers/ruby-archive-tar-minitar any more. Bump PKGREVISION.
Update graphics/ruby-color to 1.4.1. * Use lang/ruby/gem.mk instead of misc/rubygems/rubygem.mk. * Add LICENSE. * Remove default value of GEM_BUILD. * Ajust new ruby package's framework. == Color 1.4.1 / 2010.02.03 * Imported to github. * Converted to Hoe 2.5 spec format.
Initial import of ruby18-color-1.4.0 as graphics/ruby-color. The capabilities of the Color library are limited to pure mathematical manipulation of the colors based on color theory without reference to color profiles (such as sRGB or Adobe RGB). For most purposes, when working with the RGB and HSL colors, this won't matter. However, some color models (like CIE La*b) are not supported because Color does not yet support color profiles, giving no meaningful way to convert colors in absolute color spaces (like La*b, XYZ) to non-absolute color spaces (like RGB).
Initial revision