abachrome 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.envrc +3 -0
- data/README.md +10 -0
- data/Rakefile +12 -0
- data/devenv.lock +88 -17
- data/devenv.nix +2 -1
- data/devenv.yaml +5 -12
- data/lib/abachrome/abc_decimal.rb +202 -8
- data/lib/abachrome/color.rb +77 -2
- data/lib/abachrome/color_mixins/blend.rb +53 -2
- data/lib/abachrome/color_mixins/lighten.rb +49 -2
- data/lib/abachrome/color_mixins/to_colorspace.rb +67 -2
- data/lib/abachrome/color_mixins/to_lrgb.rb +70 -2
- data/lib/abachrome/color_mixins/to_oklab.rb +67 -2
- data/lib/abachrome/color_mixins/to_oklch.rb +60 -2
- data/lib/abachrome/color_mixins/to_srgb.rb +77 -2
- data/lib/abachrome/color_models/hsv.rb +25 -2
- data/lib/abachrome/color_models/oklab.rb +19 -2
- data/lib/abachrome/color_models/oklch.rb +42 -2
- data/lib/abachrome/color_models/rgb.rb +28 -2
- data/lib/abachrome/color_space.rb +76 -2
- data/lib/abachrome/converter.rb +57 -3
- data/lib/abachrome/converters/base.rb +69 -2
- data/lib/abachrome/converters/lrgb_to_oklab.rb +28 -2
- data/lib/abachrome/converters/lrgb_to_srgb.rb +27 -2
- data/lib/abachrome/converters/oklab_to_lrgb.rb +34 -2
- data/lib/abachrome/converters/oklab_to_oklch.rb +31 -2
- data/lib/abachrome/converters/oklab_to_srgb.rb +27 -2
- data/lib/abachrome/converters/oklch_to_lrgb.rb +25 -2
- data/lib/abachrome/converters/oklch_to_oklab.rb +27 -2
- data/lib/abachrome/converters/oklch_to_srgb.rb +26 -2
- data/lib/abachrome/converters/srgb_to_lrgb.rb +26 -2
- data/lib/abachrome/converters/srgb_to_oklab.rb +28 -2
- data/lib/abachrome/converters/srgb_to_oklch.rb +27 -2
- data/lib/abachrome/gamut/base.rb +2 -2
- data/lib/abachrome/gamut/p3.rb +2 -2
- data/lib/abachrome/gamut/rec2020.rb +2 -2
- data/lib/abachrome/gamut/srgb.rb +20 -2
- data/lib/abachrome/illuminants/base.rb +2 -2
- data/lib/abachrome/illuminants/d50.rb +2 -2
- data/lib/abachrome/illuminants/d55.rb +2 -2
- data/lib/abachrome/illuminants/d65.rb +2 -2
- data/lib/abachrome/illuminants/d75.rb +2 -2
- data/lib/abachrome/named/css.rb +149 -158
- data/lib/abachrome/outputs/css.rb +2 -2
- data/lib/abachrome/palette.rb +112 -2
- data/lib/abachrome/palette_mixins/interpolate.rb +20 -2
- data/lib/abachrome/palette_mixins/resample.rb +2 -2
- data/lib/abachrome/palette_mixins/stretch_luminance.rb +2 -2
- data/lib/abachrome/parsers/hex.rb +2 -2
- data/lib/abachrome/to_abcd.rb +10 -2
- data/lib/abachrome/version.rb +2 -2
- data/lib/abachrome.rb +78 -2
- data/logo.png +0 -0
- data/logo.webp +0 -0
- metadata +15 -67
data/lib/abachrome/palette.rb
CHANGED
@@ -1,13 +1,26 @@
|
|
1
|
-
#
|
1
|
+
#
|
2
2
|
|
3
3
|
module Abachrome
|
4
4
|
class Palette
|
5
5
|
attr_reader :colors
|
6
6
|
|
7
|
+
# Initializes a new color palette with the given colors.
|
8
|
+
# Automatically converts non-Color objects to Color objects by parsing them as hex values.
|
9
|
+
#
|
10
|
+
# @param colors [Array] An array of colors to include in the palette. Each element can be
|
11
|
+
# either a Color object or a string-convertible object representing a hex color code.
|
12
|
+
# @return [Abachrome::Palette] A new palette instance containing the provided colors.
|
7
13
|
def initialize(colors = [])
|
8
14
|
@colors = colors.map { |c| c.is_a?(Color) ? c : Color.from_hex(c.to_s) }
|
9
15
|
end
|
10
16
|
|
17
|
+
# Adds a color to the palette.
|
18
|
+
# Accepts either an Abachrome::Color object or any object that can be
|
19
|
+
# converted to a string and parsed as a hex color code.
|
20
|
+
#
|
21
|
+
# @param color [Abachrome::Color, String, #to_s] The color to add to the palette.
|
22
|
+
# If not already an Abachrome::Color object, it will be converted using Color.from_hex
|
23
|
+
# @return [Abachrome::Palette] self, enabling method chaining
|
11
24
|
def add(color)
|
12
25
|
color = Color.from_hex(color.to_s) unless color.is_a?(Color)
|
13
26
|
@colors << color
|
@@ -16,64 +29,141 @@ module Abachrome
|
|
16
29
|
|
17
30
|
alias << add
|
18
31
|
|
32
|
+
# Removes the specified color from the palette.
|
33
|
+
#
|
34
|
+
# @param color [Abachrome::Color, Object] The color to be removed from the palette
|
35
|
+
# @return [Abachrome::Palette] Returns self for method chaining
|
19
36
|
def remove(color)
|
20
37
|
@colors.delete(color)
|
21
38
|
self
|
22
39
|
end
|
23
40
|
|
41
|
+
# Clears all colors from the palette.
|
42
|
+
#
|
43
|
+
# This method removes all stored colors in the palette. It provides a way to
|
44
|
+
# reset the palette to an empty state while maintaining the same palette object.
|
45
|
+
#
|
46
|
+
# @return [Abachrome::Palette] Returns self for method chaining
|
24
47
|
def clear
|
25
48
|
@colors.clear
|
26
49
|
self
|
27
50
|
end
|
28
51
|
|
52
|
+
# Returns the number of colors in the palette.
|
53
|
+
#
|
54
|
+
# @return [Integer] the number of colors in the palette
|
29
55
|
def size
|
30
56
|
@colors.size
|
31
57
|
end
|
32
58
|
|
59
|
+
# Returns whether the palette has no colors.
|
60
|
+
#
|
61
|
+
# @return [Boolean] true if the palette contains no colors, false otherwise
|
33
62
|
def empty?
|
34
63
|
@colors.empty?
|
35
64
|
end
|
36
65
|
|
66
|
+
# Yields each color in the palette to the given block.
|
67
|
+
#
|
68
|
+
# @param block [Proc] The block to be executed for each color in the palette.
|
69
|
+
# @yield [Abachrome::Color] Each color in the palette.
|
70
|
+
# @return [Enumerator] Returns an Enumerator if no block is given.
|
71
|
+
# @see Enumerable#each
|
37
72
|
def each(&block)
|
38
73
|
@colors.each(&block)
|
39
74
|
end
|
75
|
+
# Calls the given block once for each color in the palette, passing the color and its index as parameters.
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# palette.each_with_index { |color, index| puts "Color #{index}: #{color}" }
|
79
|
+
#
|
80
|
+
# @param block [Proc] The block to be called for each color
|
81
|
+
# @yield [color, index] Yields a color and its index
|
82
|
+
# @yieldparam color [Abachrome::Color] The color at the current position
|
83
|
+
# @yieldparam index [Integer] The index of the current color
|
84
|
+
# @return [Enumerator] If no block is given, returns an Enumerator
|
85
|
+
# @return [Array<Abachrome::Color>] Returns the array of colors if a block is given
|
40
86
|
def each_with_index(&block)
|
41
87
|
@colors.each_with_index(&block)
|
42
88
|
end
|
43
89
|
|
90
|
+
# Maps the palette by applying a block to each color.
|
91
|
+
#
|
92
|
+
# @param block [Proc] A block that takes a color and returns a new color.
|
93
|
+
# @return [Abachrome::Palette] A new palette with the mapped colors.
|
94
|
+
# @example
|
95
|
+
# # Convert all colors in palette to grayscale
|
96
|
+
# palette.map { |color| color.grayscale }
|
44
97
|
def map(&block)
|
45
98
|
self.class.new(@colors.map(&block))
|
46
99
|
end
|
47
100
|
|
101
|
+
# Returns a duplicate of the internal colors array.
|
102
|
+
#
|
103
|
+
# @return [Array<Abachrome::Color>] A duplicate of the palette's color array
|
48
104
|
def to_a
|
49
105
|
@colors.dup
|
50
106
|
end
|
51
107
|
|
108
|
+
# Access a color in the palette at the specified index.
|
109
|
+
#
|
110
|
+
# @param index [Integer] The index of the color to retrieve from the palette
|
111
|
+
# @return [Abachrome::Color, nil] The color at the specified index, or nil if the index is out of bounds
|
52
112
|
def [](index)
|
53
113
|
@colors[index]
|
54
114
|
end
|
55
115
|
|
116
|
+
# Slices the palette to create a new palette with a subset of colors.
|
117
|
+
#
|
118
|
+
# @param start [Integer] The starting index (or range) from which to start the slice.
|
119
|
+
# @param length [Integer, nil] The number of colors to include in the slice. If nil and start is an Integer,
|
120
|
+
# returns a new palette containing the single color at that index. If start is a Range, length is ignored.
|
121
|
+
# @return [Abachrome::Palette] A new palette containing the selected colors.
|
56
122
|
def slice(start, length = nil)
|
57
123
|
new_colors = length ? @colors[start, length] : @colors[start]
|
58
124
|
self.class.new(new_colors)
|
59
125
|
end
|
60
126
|
|
127
|
+
# Returns the first color in the palette.
|
128
|
+
#
|
129
|
+
# @return [Abachrome::Color, nil] The first color in the palette, or nil if the palette is empty.
|
61
130
|
def first
|
62
131
|
@colors.first
|
63
132
|
end
|
64
133
|
|
134
|
+
# Returns the last color in the palette.
|
135
|
+
#
|
136
|
+
# @return [Abachrome::Color, nil] The last color in the palette or nil if palette is empty.
|
65
137
|
def last
|
66
138
|
@colors.last
|
67
139
|
end
|
68
140
|
|
141
|
+
# Returns a new palette with colors sorted by lightness.
|
142
|
+
# This method creates a new palette instance containing the same colors as the current
|
143
|
+
# palette but sorted in ascending order based on their lightness values.
|
144
|
+
#
|
145
|
+
# @return [Abachrome::Palette] a new palette with the same colors sorted by lightness
|
69
146
|
def sort_by_lightness
|
70
147
|
self.class.new(@colors.sort_by(&:lightness))
|
71
148
|
end
|
72
149
|
|
150
|
+
# Returns a new palette with colors sorted by saturation from lowest to highest.
|
151
|
+
# Saturation is determined by the second coordinate (a*) in the OKLAB color space.
|
152
|
+
# Lower values represent less saturated colors, higher values represent more saturated colors.
|
153
|
+
#
|
154
|
+
# @return [Abachrome::Palette] A new palette instance with the same colors sorted by saturation
|
73
155
|
def sort_by_saturation
|
74
156
|
self.class.new(@colors.sort_by { |c| c.to_oklab.coordinates[1] })
|
75
157
|
end
|
76
158
|
|
159
|
+
# Blends all colors in the palette together sequentially at the specified amount.
|
160
|
+
# This method takes each color in the palette and blends it with the accumulated result
|
161
|
+
# of previous blends. It starts with the first color and progressively blends each subsequent
|
162
|
+
# color at the specified blend amount.
|
163
|
+
#
|
164
|
+
# @param amount [Float] The blend amount to use between each color pair, between 0.0 and 1.0.
|
165
|
+
# Defaults to 0.5 (equal blend).
|
166
|
+
# @return [Abachrome::Color, nil] The final blended color result, or nil if the palette is empty.
|
77
167
|
def blend_all(amount = 0.5)
|
78
168
|
return nil if empty?
|
79
169
|
|
@@ -84,6 +174,13 @@ module Abachrome
|
|
84
174
|
result
|
85
175
|
end
|
86
176
|
|
177
|
+
# Calculates the average color of the palette by finding the centroid in OKLAB space.
|
178
|
+
# This method converts each color in the palette to OKLAB coordinates,
|
179
|
+
# calculates the arithmetic mean of these coordinates, and creates a new
|
180
|
+
# color from the average values. Alpha values are also averaged.
|
181
|
+
#
|
182
|
+
# @return [Abachrome::Color, nil] The average color of all colors in the palette,
|
183
|
+
# or nil if the palette is empty
|
87
184
|
def average
|
88
185
|
return nil if empty?
|
89
186
|
|
@@ -100,6 +197,16 @@ module Abachrome
|
|
100
197
|
)
|
101
198
|
end
|
102
199
|
|
200
|
+
# Converts the colors in the palette to CSS-formatted strings.
|
201
|
+
#
|
202
|
+
# The format of the output can be specified with the format parameter.
|
203
|
+
#
|
204
|
+
# @param format [Symbol] The format to use for the CSS color strings.
|
205
|
+
# :hex - Outputs colors in hexadecimal format (e.g., "#RRGGBB")
|
206
|
+
# :rgb - Outputs colors in rgb() function format
|
207
|
+
# :oklab - Outputs colors in oklab() function format
|
208
|
+
# When any other value is provided, a default format is used.
|
209
|
+
# @return [Array<String>] An array of CSS-formatted color strings
|
103
210
|
def to_css(format: :hex)
|
104
211
|
to_a.map do |color|
|
105
212
|
case format
|
@@ -115,6 +222,9 @@ module Abachrome
|
|
115
222
|
end
|
116
223
|
end
|
117
224
|
|
225
|
+
# Returns a string representation of the palette for inspection purposes.
|
226
|
+
#
|
227
|
+
# @return [String] A string containing the class name and a list of colors in the palette
|
118
228
|
def inspect
|
119
229
|
"#<#{self.class} colors=#{@colors.map(&:to_s)}>"
|
120
230
|
end
|
@@ -128,4 +238,4 @@ module Abachrome
|
|
128
238
|
include mixin_module
|
129
239
|
end
|
130
240
|
end
|
131
|
-
end
|
241
|
+
end
|
@@ -1,4 +1,22 @@
|
|
1
|
-
#
|
1
|
+
# Abachrome::PaletteMixins::Interpolate - Color palette interpolation functionality
|
2
|
+
#
|
3
|
+
# This mixin provides methods for interpolating between adjacent colors in a palette to create
|
4
|
+
# smooth color transitions and gradients. The interpolation process inserts new colors between
|
5
|
+
# existing palette colors by blending them at calculated intervals, creating smoother color
|
6
|
+
# progressions ideal for gradients, color ramps, and visual transitions.
|
7
|
+
#
|
8
|
+
# Key features:
|
9
|
+
# - Insert specified number of interpolated colors between each adjacent color pair
|
10
|
+
# - Both non-destructive (interpolate) and destructive (interpolate!) variants
|
11
|
+
# - Uses color blending in the current color space for smooth transitions
|
12
|
+
# - Maintains original colors as anchor points in the interpolated result
|
13
|
+
# - High-precision decimal arithmetic for accurate color calculations
|
14
|
+
# - Preserves alpha values during interpolation process
|
15
|
+
#
|
16
|
+
# The mixin includes both immutable methods that return new palette instances and mutable
|
17
|
+
# methods that modify the current palette object in place, providing flexibility for
|
18
|
+
# different use cases and performance requirements. Interpolation is essential for creating
|
19
|
+
# smooth color gradients and ensuring adequate color resolution in palette-based applications.
|
2
20
|
|
3
21
|
module Abachrome
|
4
22
|
module PaletteMixins
|
@@ -28,4 +46,4 @@ module Abachrome
|
|
28
46
|
end
|
29
47
|
end
|
30
48
|
end
|
31
|
-
end
|
49
|
+
end
|
data/lib/abachrome/to_abcd.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
#
|
1
|
+
#
|
2
2
|
|
3
3
|
module Abachrome
|
4
4
|
module ToAbcd
|
5
|
+
# Converts the receiver to an AbcDecimal object.
|
6
|
+
#
|
7
|
+
# This method converts the receiver (typically a numeric value) to an AbcDecimal
|
8
|
+
# instance, which provides high precision decimal arithmetic capabilities for
|
9
|
+
# color space calculations.
|
10
|
+
#
|
11
|
+
# @return [Abachrome::AbcDecimal] a new AbcDecimal instance representing the
|
12
|
+
# same numeric value as the receiver
|
5
13
|
def to_abcd
|
6
14
|
AbcDecimal.new(self)
|
7
15
|
end
|
@@ -10,4 +18,4 @@ end
|
|
10
18
|
|
11
19
|
[Numeric, String, Rational].each do |klass|
|
12
20
|
klass.include(Abachrome::ToAbcd)
|
13
|
-
end
|
21
|
+
end
|
data/lib/abachrome/version.rb
CHANGED
data/lib/abachrome.rb
CHANGED
@@ -1,4 +1,18 @@
|
|
1
|
-
#
|
1
|
+
# Abachrome - A Ruby color manipulation library
|
2
|
+
#
|
3
|
+
# This is the main entry point for the Abachrome library, providing color creation,
|
4
|
+
# conversion, and manipulation capabilities across multiple color spaces including
|
5
|
+
# sRGB, OKLAB, OKLCH, and linear RGB.
|
6
|
+
#
|
7
|
+
# Key features:
|
8
|
+
# - Create colors from RGB, OKLAB, OKLCH values or hex strings
|
9
|
+
# - Convert between different color spaces
|
10
|
+
# - Parse colors from hex codes and CSS color names
|
11
|
+
# - Register custom color spaces and converters
|
12
|
+
# - High-precision decimal arithmetic for accurate color calculations
|
13
|
+
#
|
14
|
+
# The library uses autoloading for efficient memory usage and provides both
|
15
|
+
# functional and object-oriented APIs for color operations.
|
2
16
|
|
3
17
|
require_relative "abachrome/to_abcd"
|
4
18
|
|
@@ -57,27 +71,69 @@ module Abachrome
|
|
57
71
|
autoload :Hex, "abachrome/parsers/hex"
|
58
72
|
end
|
59
73
|
|
74
|
+
# Creates a new color in the specified color space with given coordinates and alpha value.
|
75
|
+
#
|
76
|
+
# @param space_name [Symbol, String] The name of the color space (e.g., :srgb, :oklch)
|
77
|
+
# @param coordinates [Array<Numeric>] The color coordinates in the specified color space
|
78
|
+
# @param alpha [Float] The alpha (opacity) value of the color, defaults to 1.0 (fully opaque)
|
79
|
+
# @return [Abachrome::Color] A new Color object in the specified color space with the given coordinates
|
60
80
|
def create_color(space_name, *coordinates, alpha: 1.0)
|
61
81
|
space = ColorSpace.find(space_name)
|
62
82
|
Color.new(space, coordinates, alpha)
|
63
83
|
end
|
64
84
|
|
85
|
+
# Creates a color object from RGB values.
|
86
|
+
#
|
87
|
+
# @param r [Numeric] The red component value (typically 0-255 or 0.0-1.0)
|
88
|
+
# @param g [Numeric] The green component value (typically 0-255 or 0.0-1.0)
|
89
|
+
# @param b [Numeric] The blue component value (typically 0-255 or 0.0-1.0)
|
90
|
+
# @param alpha [Float] The alpha (opacity) component value (0.0-1.0), defaults to 1.0 (fully opaque)
|
91
|
+
# @return [Abachrome::Color] A new Color object initialized with the specified RGB values
|
65
92
|
def from_rgb(r, g, b, alpha = 1.0)
|
66
93
|
Color.from_rgb(r, g, b, alpha)
|
67
94
|
end
|
68
95
|
|
96
|
+
# Creates a color in the OKLAB color space.
|
97
|
+
#
|
98
|
+
# @param l [Numeric] The lightness component (L) in the OKLAB color space, typically in range 0 to 1
|
99
|
+
# @param a [Numeric] The green-red component (a) in the OKLAB color space
|
100
|
+
# @param b [Numeric] The blue-yellow component (b) in the OKLAB color space
|
101
|
+
# @param alpha [Float] The alpha (opacity) value, ranging from 0.0 (transparent) to 1.0 (opaque), defaults to 1.0
|
102
|
+
# @return [Abachrome::Color] A new Color object in the OKLAB color space
|
69
103
|
def from_oklab(l, a, b, alpha = 1.0)
|
70
104
|
Color.from_oklab(l, a, b, alpha)
|
71
105
|
end
|
72
106
|
|
107
|
+
# Creates a new color from OKLCH color space values.
|
108
|
+
#
|
109
|
+
# @param l [Numeric] The lightness value, typically in range 0-1
|
110
|
+
# @param a [Numeric] The chroma (colorfulness) value
|
111
|
+
# @param b [Numeric] The hue angle value in degrees (0-360)
|
112
|
+
# @param alpha [Numeric] The alpha (opacity) value, between 0-1 (default: 1.0)
|
113
|
+
# @return [Abachrome::Color] A new color object initialized with the given OKLCH values
|
73
114
|
def from_oklch(l, a, b, alpha = 1.0)
|
74
115
|
Color.from_oklch(l, a, b, alpha)
|
75
116
|
end
|
76
117
|
|
118
|
+
# Creates a color object from a hexadecimal color code string.
|
119
|
+
#
|
120
|
+
# @param hex_str [String] The hexadecimal color code string to parse. Can be in formats like
|
121
|
+
# "#RGB", "#RRGGBB", "RGB", or "RRGGBB", with or without the leading "#" character.
|
122
|
+
# @return [Abachrome::Color] A new Color object representing the parsed hexadecimal color.
|
123
|
+
# @example
|
124
|
+
# Abachrome.from_hex("#ff0000") # => returns a red Color object
|
125
|
+
# Abachrome.from_hex("00ff00") # => returns a green Color object
|
126
|
+
# @see Abachrome::Parsers::Hex.parse
|
77
127
|
def from_hex(hex_str)
|
78
128
|
Parsers::Hex.parse(hex_str)
|
79
129
|
end
|
80
130
|
|
131
|
+
# Creates a color object from a CSS color name.
|
132
|
+
#
|
133
|
+
# @param color_name [String] The CSS color name (e.g., 'red', 'blue', 'cornflowerblue').
|
134
|
+
# Case-insensitive.
|
135
|
+
# @return [Abachrome::Color, nil] A color object in the RGB color space if the name is valid,
|
136
|
+
# nil if the color name is not recognized.
|
81
137
|
def from_name(color_name)
|
82
138
|
rgb_values = Named::CSS::ColorNames[color_name.downcase]
|
83
139
|
return nil unless rgb_values
|
@@ -85,15 +141,35 @@ module Abachrome
|
|
85
141
|
from_rgb(*rgb_values.map { |v| v / 255.0 })
|
86
142
|
end
|
87
143
|
|
144
|
+
# Convert a color from its current color space to another color space.
|
145
|
+
#
|
146
|
+
# @param color [Abachrome::Color] The color object to convert
|
147
|
+
# @param to_space [Symbol, String] The destination color space identifier (e.g. :srgb, :oklch)
|
148
|
+
# @return [Abachrome::Color] A new color object in the specified color space
|
88
149
|
def convert(color, to_space)
|
89
150
|
Converter.convert(color, to_space)
|
90
151
|
end
|
91
152
|
|
153
|
+
# Register a new color space with the Abachrome library.
|
154
|
+
#
|
155
|
+
# @param name [Symbol, String] The identifier for the color space being registered
|
156
|
+
# @param block [Proc] A block that defines the color space properties and conversion rules
|
157
|
+
# @return [Abachrome::ColorSpace] The newly registered color space object
|
92
158
|
def register_color_space(name, &block)
|
93
159
|
ColorSpace.register(name, &block)
|
94
160
|
end
|
95
161
|
|
162
|
+
# Register a new color space converter in the Abachrome system.
|
163
|
+
#
|
164
|
+
# This method allows registering custom converters between color spaces.
|
165
|
+
# Converters are used to transform color representations from one color
|
166
|
+
# space to another.
|
167
|
+
#
|
168
|
+
# @param from_space [Symbol, String] The source color space identifier
|
169
|
+
# @param to_space [Symbol, String] The destination color space identifier
|
170
|
+
# @param converter [#call] An object responding to #call that performs the conversion
|
171
|
+
# @return [void]
|
96
172
|
def register_converter(from_space, to_space, converter)
|
97
173
|
Converter.register(from_space, to_space, converter)
|
98
174
|
end
|
99
|
-
end
|
175
|
+
end
|
data/logo.png
ADDED
Binary file
|
data/logo.webp
ADDED
Binary file
|
metadata
CHANGED
@@ -1,96 +1,44 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abachrome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Durable Programming
|
7
|
+
- Durable Programming
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bigdecimal
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0.0
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: dry-inflector
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
19
|
+
version: '1.0'
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 5.25.0
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 5.25.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '13.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '13.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: simplecov
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.22.0
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.22.0
|
83
|
-
description: 'Abachrome provides a robust set of tools for working with colors: parsing,
|
84
|
-
manipulation, conversion, etc. Supports RGB, HSV, OkLab and OkLch.'
|
26
|
+
version: '1.0'
|
27
|
+
description: Abachrome provides a robust set of tools for working with various color
|
28
|
+
formats including hex, RGB, HSL, and named colors. Features support for multiple
|
29
|
+
color spaces (RGB, HSL, Lab, Oklab), color space conversion, gamut mapping, CSS
|
30
|
+
color parsing and formatting, and high-precision color calculations using BigDecimal.
|
85
31
|
email:
|
86
|
-
-
|
32
|
+
- commercial@durableprogramming.com
|
87
33
|
executables: []
|
88
34
|
extensions: []
|
89
35
|
extra_rdoc_files: []
|
90
36
|
files:
|
37
|
+
- ".envrc"
|
91
38
|
- ".rubocop.yml"
|
92
39
|
- CHANGELOG.md
|
93
40
|
- README.md
|
41
|
+
- Rakefile
|
94
42
|
- demos/ncurses/plasma.rb
|
95
43
|
- devenv.lock
|
96
44
|
- devenv.nix
|
@@ -141,15 +89,15 @@ files:
|
|
141
89
|
- lib/abachrome/parsers/hex.rb
|
142
90
|
- lib/abachrome/to_abcd.rb
|
143
91
|
- lib/abachrome/version.rb
|
92
|
+
- logo.png
|
93
|
+
- logo.webp
|
144
94
|
homepage: https://github.com/durableprogramming/abachrome
|
145
95
|
licenses:
|
146
96
|
- MIT
|
147
97
|
metadata:
|
148
|
-
allowed_push_host: https://rubygems.org
|
149
98
|
homepage_uri: https://github.com/durableprogramming/abachrome
|
150
99
|
source_code_uri: https://github.com/durableprogramming/abachrome
|
151
100
|
changelog_uri: https://github.com/durableprogramming/abachrome/blob/main/CHANGELOG.md
|
152
|
-
rubygems_mfa_required: 'true'
|
153
101
|
post_install_message:
|
154
102
|
rdoc_options: []
|
155
103
|
require_paths:
|
@@ -165,8 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
113
|
- !ruby/object:Gem::Version
|
166
114
|
version: '0'
|
167
115
|
requirements: []
|
168
|
-
rubygems_version: 3.5.
|
116
|
+
rubygems_version: 3.5.9
|
169
117
|
signing_key:
|
170
118
|
specification_version: 4
|
171
|
-
summary:
|
119
|
+
summary: A Ruby gem for parsing, manipulating, and managing colors
|
172
120
|
test_files: []
|