public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-red-colors] rawhide: remove unneeded patch
@ 2026-09-10  1:30 Mamoru TASAKA
  0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-09-10  1:30 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rubygem-red-colors
Branch : rawhide
Commit : 36865469f8f07584f5728250ad3a31963b9bd89b
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-09-09T15:02:52+09:00
Stats  : +0/-196 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-red-colors/c/36865469f8f07584f5728250ad3a31963b9bd89b?branch=rawhide

Log:
remove unneeded patch

---
diff --git a/rubygem-red-colors-0.3.0-pr17-suppress-warnings.patch b/rubygem-red-colors-0.3.0-pr17-suppress-warnings.patch
deleted file mode 100644
index e29e9ca..0000000
--- a/rubygem-red-colors-0.3.0-pr17-suppress-warnings.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-From 4b4e6eff136be38a27282979d139dec7f896e58c Mon Sep 17 00:00:00 2001
-From: Sutou Kouhei <kou@clear-code.com>
-Date: Sat, 11 Sep 2021 04:36:21 +0900
-Subject: [PATCH 1/2] Suppress warnings
-
-fix #16
-
-Reported by rubyFeedback. Thanks!!!
----
- lib/colors/colormap_data/matplotlib_builtin.rb |  2 +-
- lib/colors/colormap_registry.rb                |  1 -
- lib/colors/linear_segmented_colormap.rb        |  2 --
- lib/colors/xterm256.rb                         | 12 ++++--------
- test/run.rb                                    |  3 +--
- 5 files changed, 6 insertions(+), 14 deletions(-)
-
-diff --git a/lib/colors/colormap_data/matplotlib_builtin.rb b/lib/colors/colormap_data/matplotlib_builtin.rb
-index 0920bfd..1f9e1da 100644
---- a/lib/colors/colormap_data/matplotlib_builtin.rb
-+++ b/lib/colors/colormap_data/matplotlib_builtin.rb
-@@ -956,7 +956,7 @@ module ColormapRegistry
-       a_data = data[a_key]
-       b_data = data[b_key]
-       a_listed = a_data.is_a?(Hash) && a_data.key?(:listed)
--      b_listed = a_data.is_a?(Hash) && a_data.key?(:listed)
-+      b_listed = b_data.is_a?(Hash) && b_data.key?(:listed)
-       case
-       when !a_listed && b_listed
-         -1
-diff --git a/lib/colors/colormap_registry.rb b/lib/colors/colormap_registry.rb
-index dfdf564..eb373ee 100644
---- a/lib/colors/colormap_registry.rb
-+++ b/lib/colors/colormap_registry.rb
-@@ -30,7 +30,6 @@ def self.register(cmap, name: nil, override_builtin: false)
-       end
- 
-       if @registry.key?(name)
--        existing = @registry[name]
-         if BUILTIN_COLORMAPS.key?(name)
-           unless override_builtin
-             raise ArgumentError,
-diff --git a/lib/colors/linear_segmented_colormap.rb b/lib/colors/linear_segmented_colormap.rb
-index a203393..46c9ec7 100644
---- a/lib/colors/linear_segmented_colormap.rb
-+++ b/lib/colors/linear_segmented_colormap.rb
-@@ -80,8 +80,6 @@ def gamma=(val)
-         raise ArgumentError, "data array must consist of 3-length arrays"
-       end
- 
--      shape = [ary.length, 3]
--
-       x, y0, y1 = ary.transpose
- 
-       if x[0] != 0.0 || x[-1] != 1.0
-diff --git a/lib/colors/xterm256.rb b/lib/colors/xterm256.rb
-index 6a1ea95..ee55ecb 100644
---- a/lib/colors/xterm256.rb
-+++ b/lib/colors/xterm256.rb
-@@ -39,14 +39,10 @@ def to_rgb_components
-       end
-     end
- 
--    def to_grey_level
--      if code < 232
--        r, g, b = to_rgb_components
--        x, y, z = Convet.rgb_to_xyz(r, g, b)
--      else
--        grey = 10*(code - 232) + 8
--        canonicalize_component_from_integer(grey, :grey)
--      end
-+    private def to_grey_level
-+      # must be "code < 232"
-+      grey = 10*(code - 232) + 8
-+      canonicalize_component_from_integer(grey, :grey)
-     end
- 
-     def to_rgb
-diff --git a/test/run.rb b/test/run.rb
-index c49c064..c7a4230 100755
---- a/test/run.rb
-+++ b/test/run.rb
-@@ -1,7 +1,6 @@
- #!/usr/bin/env ruby
- 
--# TODO
--# $VERBOSE = true
-+$VERBOSE = true
- 
- require "pathname"
- 
-
-From 0575993210c8faee33e2dad972f3b4faf364e088 Mon Sep 17 00:00:00 2001
-From: Kenta Murata <mrkn@mrkn.jp>
-Date: Sun, 7 Nov 2021 13:56:33 +0900
-Subject: [PATCH 2/2] Fix Colors::Xterm256#to_grey_level
-
----
- lib/colors/convert.rb  |  6 ++++++
- lib/colors/xterm256.rb | 13 +++++++++----
- test/test-xterm256.rb  | 22 ++++++++++++++++++----
- 3 files changed, 33 insertions(+), 8 deletions(-)
-
-diff --git a/lib/colors/convert.rb b/lib/colors/convert.rb
-index d75b0c0..ac210f1 100644
---- a/lib/colors/convert.rb
-+++ b/lib/colors/convert.rb
-@@ -150,6 +150,12 @@ def rgb_to_xyz(r, g, b)
-       dot_product(RGB2XYZ, srgb_to_linear_srgb(r, g, b))
-     end
- 
-+    def rgb_to_greyscale(r, g, b)
-+      r, g, b = srgb_to_linear_srgb(r, g, b)
-+      a = RGB2XYZ[1]
-+      (a[0]*r + a[1]*g + a[2]*b).clamp(0, 1)
-+    end
-+
-     def rgb_to_xterm256(r, g, b)
-       i = closest_xterm256_rgb_index(r)
-       j = closest_xterm256_rgb_index(g)
-diff --git a/lib/colors/xterm256.rb b/lib/colors/xterm256.rb
-index ee55ecb..c54d6d5 100644
---- a/lib/colors/xterm256.rb
-+++ b/lib/colors/xterm256.rb
-@@ -39,10 +39,15 @@ def to_rgb_components
-       end
-     end
- 
--    private def to_grey_level
--      # must be "code < 232"
--      grey = 10*(code - 232) + 8
--      canonicalize_component_from_integer(grey, :grey)
-+    def to_grey_level
-+      if code < 232
-+        r, g, b = to_rgb_components
-+        y = Convert.rgb_to_greyscale(r, g, b)
-+        canonicalize_component_to_rational(y, :grey)
-+      else
-+        grey = 10*(code - 232) + 8
-+        canonicalize_component_from_integer(grey, :grey)
-+      end
-     end
- 
-     def to_rgb
-diff --git a/test/test-xterm256.rb b/test/test-xterm256.rb
-index 98d278a..5217f11 100644
---- a/test/test-xterm256.rb
-+++ b/test/test-xterm256.rb
-@@ -44,7 +44,9 @@ def test_ansi_color_code(code)
-     assert { Colors::Xterm256.new(16) != Colors::Xterm256.new(17) }
-   end
- 
--  data do
-+  RGB2GREY = [0.21263900587151035754r, 0.71516867876775592746r, 0.07219231536073371500r]
-+
-+  data(keep: true) do
-     data_set = {}
-     # colors 16-231 are a 6x6x6 color cube
-     (0...6).each do |r|
-@@ -55,7 +57,10 @@ def test_ansi_color_code(code)
-           green = (g > 0) ? 40*g + 55 : g
-           blue  = (b > 0) ? 40*b + 55 : b
-           label = "Color #{code} is rgb(#{red}, #{green}, #{blue})"
--          data_set[label] = [code, Colors::RGB.new(red, green, blue)]
-+          rgb = Colors::RGB.new(red, green, blue)
-+          red, green, blue = Colors::Convert.srgb_to_linear_srgb(*rgb.components)
-+          grey = RGB2GREY[0]*red + RGB2GREY[1]*green + RGB2GREY[2]*blue
-+          data_set[label] = [code, rgb, grey]
-         end
-       end
-     end
-@@ -63,14 +68,23 @@ def test_ansi_color_code(code)
-     (0...24).each do |y|
-       code = 232 + y
-       level = 10*y + 8
-+      grey = level/255r
-       label = "Color #{code} is gray(#{level})"
--      data_set[label] = [code, Colors::RGB.new(level, level, level)]
-+      data_set[label] = [code, Colors::RGB.new(level, level, level), grey]
-     end
-     data_set
-   end
-+
-   def test_to_rgb(data)
--    code, rgb = data
-+    code, rgb, _grey = data
-     assert_equal(rgb,
-                  Colors::Xterm256.new(code).to_rgb)
-   end
-+
-+  def test_to_grey_level(data)
-+    code, _rgb, grey = data
-+    assert_in_delta(grey,
-+                    Colors::Xterm256.new(code).to_grey_level,
-+                    1e-12)
-+  end
- end

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-10  1:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-10  1:30 [rpms/rubygem-red-colors] rawhide: remove unneeded patch Mamoru TASAKA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox