abachrome-float 0.1.6

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.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/.envrc +3 -0
  3. data/.rubocop.yml +10 -0
  4. data/CHANGELOG.md +21 -0
  5. data/CLA.md +45 -0
  6. data/CODE-OF-CONDUCT.md +9 -0
  7. data/LICENSE +19 -0
  8. data/README.md +315 -0
  9. data/Rakefile +15 -0
  10. data/SECURITY.md +94 -0
  11. data/abachrome-float.gemspec +36 -0
  12. data/demos/ncurses/plasma.rb +124 -0
  13. data/devenv.lock +171 -0
  14. data/devenv.nix +52 -0
  15. data/devenv.yaml +8 -0
  16. data/lib/abachrome/color.rb +197 -0
  17. data/lib/abachrome/color_mixins/blend.rb +100 -0
  18. data/lib/abachrome/color_mixins/lighten.rb +90 -0
  19. data/lib/abachrome/color_mixins/spectral_mix.rb +70 -0
  20. data/lib/abachrome/color_mixins/to_colorspace.rb +107 -0
  21. data/lib/abachrome/color_mixins/to_grayscale.rb +87 -0
  22. data/lib/abachrome/color_mixins/to_lrgb.rb +121 -0
  23. data/lib/abachrome/color_mixins/to_oklab.rb +117 -0
  24. data/lib/abachrome/color_mixins/to_oklch.rb +110 -0
  25. data/lib/abachrome/color_mixins/to_srgb.rb +142 -0
  26. data/lib/abachrome/color_models/cmyk.rb +159 -0
  27. data/lib/abachrome/color_models/hsv.rb +49 -0
  28. data/lib/abachrome/color_models/lms.rb +38 -0
  29. data/lib/abachrome/color_models/oklab.rb +37 -0
  30. data/lib/abachrome/color_models/oklch.rb +91 -0
  31. data/lib/abachrome/color_models/rgb.rb +58 -0
  32. data/lib/abachrome/color_models/xyz.rb +31 -0
  33. data/lib/abachrome/color_models/yiq.rb +37 -0
  34. data/lib/abachrome/color_space.rb +199 -0
  35. data/lib/abachrome/converter.rb +117 -0
  36. data/lib/abachrome/converters/base.rb +128 -0
  37. data/lib/abachrome/converters/cmyk_to_srgb.rb +42 -0
  38. data/lib/abachrome/converters/lms_to_lrgb.rb +40 -0
  39. data/lib/abachrome/converters/lms_to_srgb.rb +27 -0
  40. data/lib/abachrome/converters/lms_to_xyz.rb +34 -0
  41. data/lib/abachrome/converters/lrgb_to_lms.rb +3 -0
  42. data/lib/abachrome/converters/lrgb_to_oklab.rb +57 -0
  43. data/lib/abachrome/converters/lrgb_to_srgb.rb +59 -0
  44. data/lib/abachrome/converters/lrgb_to_xyz.rb +33 -0
  45. data/lib/abachrome/converters/oklab_to_lms.rb +44 -0
  46. data/lib/abachrome/converters/oklab_to_lrgb.rb +71 -0
  47. data/lib/abachrome/converters/oklab_to_oklch.rb +56 -0
  48. data/lib/abachrome/converters/oklab_to_srgb.rb +46 -0
  49. data/lib/abachrome/converters/oklch_to_lrgb.rb +79 -0
  50. data/lib/abachrome/converters/oklch_to_oklab.rb +52 -0
  51. data/lib/abachrome/converters/oklch_to_srgb.rb +46 -0
  52. data/lib/abachrome/converters/oklch_to_xyz.rb +70 -0
  53. data/lib/abachrome/converters/srgb_to_cmyk.rb +64 -0
  54. data/lib/abachrome/converters/srgb_to_lrgb.rb +55 -0
  55. data/lib/abachrome/converters/srgb_to_oklab.rb +45 -0
  56. data/lib/abachrome/converters/srgb_to_oklch.rb +47 -0
  57. data/lib/abachrome/converters/srgb_to_yiq.rb +49 -0
  58. data/lib/abachrome/converters/xyz_to_lms.rb +34 -0
  59. data/lib/abachrome/converters/xyz_to_oklab.rb +42 -0
  60. data/lib/abachrome/converters/yiq_to_srgb.rb +47 -0
  61. data/lib/abachrome/gamut/base.rb +74 -0
  62. data/lib/abachrome/gamut/p3.rb +27 -0
  63. data/lib/abachrome/gamut/rec2020.rb +25 -0
  64. data/lib/abachrome/gamut/srgb.rb +49 -0
  65. data/lib/abachrome/illuminants/base.rb +35 -0
  66. data/lib/abachrome/illuminants/d50.rb +33 -0
  67. data/lib/abachrome/illuminants/d55.rb +29 -0
  68. data/lib/abachrome/illuminants/d65.rb +37 -0
  69. data/lib/abachrome/illuminants/d75.rb +29 -0
  70. data/lib/abachrome/named/css.rb +157 -0
  71. data/lib/abachrome/named/tailwind.rb +301 -0
  72. data/lib/abachrome/outputs/css.rb +119 -0
  73. data/lib/abachrome/palette.rb +244 -0
  74. data/lib/abachrome/palette_mixins/interpolate.rb +53 -0
  75. data/lib/abachrome/palette_mixins/resample.rb +61 -0
  76. data/lib/abachrome/palette_mixins/stretch_luminance.rb +72 -0
  77. data/lib/abachrome/parsers/css.rb +452 -0
  78. data/lib/abachrome/parsers/hex.rb +52 -0
  79. data/lib/abachrome/parsers/tailwind.rb +45 -0
  80. data/lib/abachrome/spectral.rb +276 -0
  81. data/lib/abachrome/to_abcd.rb +23 -0
  82. data/lib/abachrome/version.rb +7 -0
  83. data/lib/abachrome.rb +242 -0
  84. data/logo.png +0 -0
  85. data/logo.webp +0 -0
  86. data/security/assesments/2025-10-12-SECURITY_ASSESSMENT.md +53 -0
  87. data/security/vex.json +21 -0
  88. metadata +146 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b60f07aeb2dcb4db6f2c95e76a491996a4dc205d8b444d4576cad57f1cac6a5f
4
+ data.tar.gz: 95f3bffe2123ad4822630e57290694c581bae13b1980f1b8d36f1ad273c958e8
5
+ SHA512:
6
+ metadata.gz: 276d7d23e132c01463f2a17802bd645ac2764634b7b756e421de98c0c42409c6eac3bcd693c4da84ef865b43b01ca1ac47bafe7e3fca6c4923420cf014b207d7
7
+ data.tar.gz: 546090227f1340344b14815c53573bf779f962251515a61480f90a2a4bd5bc860ba65f05330f02d2577876f17ae6a7471d9003c7d19d5fc18d18c5374db476e1
data/.envrc ADDED
@@ -0,0 +1,3 @@
1
+ source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
2
+
3
+ use devenv
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 3.0
4
+
5
+ Style/StringLiterals:
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ EnforcedStyle: double_quotes
10
+
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.4] - 2025-10-12
4
+
5
+ - Added `Color#to_hex` method for convenient hex string output
6
+ - Added `Abachrome.parse` method for parsing CSS color strings
7
+
8
+ ## [0.1.3] - 2025-10-12
9
+
10
+ - Enhanced color parsing with support for additional CSS formats
11
+ - Improved documentation with comprehensive user guides
12
+ - Added LICENSE file for compliance
13
+ - Security contact information added to README
14
+
15
+ ## [0.1.0] - 2025-02-09
16
+
17
+ - Initial release with core color manipulation functionality
18
+ - Support for RGB, OKLAB, OKLCH color spaces
19
+ - Basic color conversion and gamut mapping
20
+ - CSS color output formatting
21
+ - High-precision calculations using BigDecimal
data/CLA.md ADDED
@@ -0,0 +1,45 @@
1
+ # Contributor License Agreement
2
+
3
+ This Contributor License Agreement ("Agreement") is entered into between the undersigned contributor ("Contributor") and Durable Programming, LLC ("Company").
4
+
5
+ ## Recitals
6
+
7
+ WHEREAS, Contributor desires to contribute to the abachrome project ("Project");
8
+
9
+ WHEREAS, Company desires to receive contributions to the Project;
10
+
11
+ NOW, THEREFORE, in consideration of the mutual promises contained herein, the parties agree as follows:
12
+
13
+ ## Grant of Copyright
14
+
15
+ Contributor hereby assigns to Company all right, title, and interest in and to the copyright in the contributions made by Contributor to the Project, including all modifications, enhancements, and derivative works thereof.
16
+
17
+ ## Scope
18
+
19
+ This Agreement applies to all contributions made by Contributor to the Project, whether made before or after the date of this Agreement.
20
+
21
+ ## Representations and Warranties
22
+
23
+ Contributor represents and warrants that:
24
+
25
+ 1. Contributor has the right to enter into this Agreement and to grant the rights granted herein.
26
+
27
+ 2. The contributions are original works of Contributor and do not infringe any third-party rights.
28
+
29
+ 3. Contributor has not assigned or licensed the contributions to any other party.
30
+
31
+ ## Governing Law
32
+
33
+ This Agreement shall be governed by the laws of the State of Delaware, without regard to conflict of laws principles.
34
+
35
+ ## Entire Agreement
36
+
37
+ This Agreement constitutes the entire agreement between the parties and supersedes all prior agreements.
38
+
39
+ IN WITNESS WHEREOF, the parties have executed this Agreement as of the date first above written.
40
+
41
+ Contributor: ___________________________ Date: __________
42
+
43
+ Company: Durable Programming, LLC
44
+
45
+ By: ___________________________ Date: __________
@@ -0,0 +1,9 @@
1
+ # Code of Conduct
2
+
3
+ This document provides community guidelines for a safe, respectful, productive, and collaborative place for any person who is willing to contribute to the Abachrome community. It applies to all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.).
4
+
5
+ - Participants will be tolerant of opposing views.
6
+ - Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
7
+ - When interpreting the words and actions of others, participants should always assume good intentions.
8
+ - Behaviour which can be reasonably considered harassment will not be tolerated.
9
+
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2023 Durable Programming
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,315 @@
1
+ # Abachrome
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![Ruby](https://img.shields.io/badge/ruby-3.0+-red.svg)](https://www.ruby-lang.org/en/)
5
+ [![Gem Version](https://badge.fury.io/rb/abachrome.svg)](https://badge.fury.io/rb/abachrome)
6
+ [![Downloads](https://img.shields.io/gem/dt/abachrome)](https://rubygems.org/gems/abachrome)
7
+ [![GitHub repo size](https://img.shields.io/github/repo-size/durableprogramming/abachrome)](https://github.com/durableprogramming/abachrome)
8
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
9
+ [![RuboCop](https://img.shields.io/badge/code_style-rubocop-orange.svg)](https://github.com/rubocop/rubocop)
10
+ [![Maturity Level](https://img.shields.io/badge/Maturity-Level%202%20--%20First%20Release-yellowgreen.svg)](https://github.com/tophat/getting-started/blob/master/scorecard.md)
11
+ [![Website](https://img.shields.io/website-up-down-green-red/http/durableprogramming.com.svg)](https://durableprogramming.com)
12
+
13
+ Abachrome is a Ruby gem for parsing, manipulating, and managing colors. It provides a robust set of tools for working with various color formats including hex, RGB, HSL, and named colors.
14
+
15
+ ![Abachrome Logo](logo.png)
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ ```ruby
22
+ gem 'abachrome'
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ ```bash
28
+ $ bundle install
29
+ ```
30
+
31
+ Or install it yourself as:
32
+
33
+ ```bash
34
+ $ gem install abachrome
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ ### Basic Color Creation
40
+
41
+ ```ruby
42
+ # Create colors in different ways
43
+ color = Abachrome.from_rgb(1.0, 0.0, 0.0) # Red using RGB values
44
+ color = Abachrome.from_hex('#FF0000') # Red using hex
45
+ color = Abachrome.from_name('red') # Red using CSS color name
46
+
47
+ # Create color with alpha
48
+ color = Abachrome.from_rgb(1.0, 0.0, 0.0, 0.5) # Semi-transparent red
49
+ ```
50
+
51
+ ### Color Space Conversion
52
+
53
+ ```ruby
54
+ # Convert between color spaces
55
+ rgb_color = Abachrome.from_rgb(1.0, 0.0, 0.0)
56
+ oklab_color = rgb_color.to_oklab # Convert to Oklab
57
+ rgb_again = oklab_color.to_rgb # Convert back to RGB
58
+ ```
59
+
60
+ ### Color Output Formats
61
+
62
+ ```ruby
63
+ color = Abachrome.from_rgb(1.0, 0.0, 0.0)
64
+
65
+ # Different output formats
66
+ color.rgb_hex # => "#ff0000"
67
+ Abachrome::Outputs::CSS.format(color) # => "#ff0000"
68
+ Abachrome::Outputs::CSS.format_rgb(color) # => "rgb(255, 0, 0)"
69
+ ```
70
+
71
+ ### Working with Color Gamuts
72
+
73
+ ```ruby
74
+ # Check if color is within gamut
75
+ srgb_gamut = Abachrome::Gamut::SRGB.new
76
+ color = Abachrome.from_rgb(1.2, -0.1, 0.5)
77
+ mapped_color = srgb_gamut.map(color.coordinates) # Map color to gamut
78
+ ```
79
+
80
+ ### Parsing Colors
81
+
82
+ Abachrome supports parsing colors from various string formats using the CSS parser:
83
+
84
+ ```ruby
85
+ # Hex colors
86
+ color = Abachrome::Parsers::CSS.parse('#ff0000')
87
+ color = Abachrome::Parsers::CSS.parse('#f00') # Short hex
88
+
89
+ # RGB and HSL strings
90
+ color = Abachrome::Parsers::CSS.parse('rgb(255, 0, 0)')
91
+ color = Abachrome::Parsers::CSS.parse('rgba(255, 0, 0, 0.5)')
92
+ color = Abachrome::Parsers::CSS.parse('hsl(0, 100%, 50%)')
93
+
94
+ # Named colors
95
+ color = Abachrome::Parsers::CSS.parse('red')
96
+
97
+ # Advanced formats
98
+ color = Abachrome::Parsers::CSS.parse('oklab(0.5 0.2 -0.1)')
99
+ color = Abachrome::Parsers::CSS.parse('oklch(0.5 0.2 120)')
100
+ ```
101
+
102
+ ### Color Manipulation
103
+
104
+ Abachrome provides methods for blending and adjusting colors:
105
+
106
+ ```ruby
107
+ color1 = Abachrome.from_rgb(1.0, 0.0, 0.0)
108
+ color2 = Abachrome.from_rgb(0.0, 1.0, 0.0)
109
+
110
+ # Blend two colors
111
+ blended = color1.blend(color2, 0.5) # 50% blend
112
+
113
+ # Adjust lightness
114
+ lighter = color1.lighten(0.2) # Lighten by 20%
115
+ ```
116
+
117
+ ### Working with Palettes
118
+
119
+ Create and manipulate color palettes:
120
+
121
+ ```ruby
122
+ palette = Abachrome::Palette.new([color1, color2])
123
+
124
+ # Interpolate between colors
125
+ interpolated = palette.interpolate(steps: 5) # Add 5 interpolated colors between each pair
126
+ ```
127
+
128
+ ### Advanced Gamut Mapping
129
+
130
+ Map colors to different color gamuts for accurate display:
131
+
132
+ ```ruby
133
+ srgb_gamut = Abachrome::Gamut::SRGB.new
134
+ p3_gamut = Abachrome::Gamut::P3.new
135
+
136
+ out_of_gamut = Abachrome.from_rgb(1.2, -0.1, 0.5)
137
+ mapped_srgb = srgb_gamut.map(out_of_gamut.coordinates)
138
+ mapped_p3 = p3_gamut.map(out_of_gamut.coordinates)
139
+ ```
140
+
141
+ ## Features
142
+
143
+ - Support for multiple color spaces (RGB, HSL, Lab, Oklab, OKLCH, XYZ, LMS)
144
+ - Color space conversion between all supported spaces
145
+ - Advanced gamut mapping for sRGB, P3, and Rec.2020
146
+ - Comprehensive CSS color parsing and formatting
147
+ - Support for CSS named colors
148
+ - Color blending and lightness adjustments
149
+ - Palette creation and interpolation
150
+ - High-precision color calculations using BigDecimal
151
+ - Alpha channel support throughout all operations
152
+
153
+ ## Requirements
154
+
155
+ - Ruby >= 3.0.0
156
+
157
+ ## Dependencies
158
+
159
+ Abachrome has minimal dependencies to maintain performance and compatibility:
160
+
161
+ ### Runtime Dependencies
162
+ - **dry-inflector** (~> 1.0): Provides utilities for dynamic class loading and color space management
163
+
164
+ ### Development Dependencies
165
+ - Testing framework (minitest)
166
+ - Code quality tools (rubocop)
167
+
168
+ ### Dependency Management
169
+ Dependencies are specified in `abachrome.gemspec` and managed via Bundler.
170
+
171
+ To check for dependency updates:
172
+ ```bash
173
+ bundle outdated
174
+ ```
175
+
176
+ To update dependencies:
177
+ ```bash
178
+ bundle update
179
+ ```
180
+
181
+ All dependencies are selected based on:
182
+ - Active maintenance and community support
183
+ - Minimal footprint and performance impact
184
+ - Compatibility with Ruby 3.0+ requirements
185
+
186
+ ## License
187
+
188
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
189
+
190
+ ## Development
191
+
192
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
193
+
194
+ To install this gem onto your local machine, run `bundle exec rake install`.
195
+
196
+ ### Testing
197
+
198
+ Tests are run automatically in CI/CD pipelines for all pull requests and pushes to the main branch. The test suite includes:
199
+
200
+ - Unit tests for all color models and converters
201
+ - Integration tests for parsing and output functionality
202
+ - Performance benchmarks for critical operations
203
+
204
+ To run tests locally:
205
+ ```bash
206
+ rake test
207
+ ```
208
+
209
+ Tests must pass before any changes can be merged to the main branch.
210
+
211
+ ### Testing Policy
212
+
213
+ - **All changes**: Must not break existing tests
214
+ - **New features**: Must include comprehensive unit tests
215
+ - **Bug fixes**: Must include regression tests
216
+ - **Major changes**: Require code review and may need additional integration tests
217
+ - **Performance changes**: Must include benchmark comparisons
218
+
219
+ All pull requests require tests to pass CI checks before merging.
220
+
221
+ ## Contributing
222
+
223
+ We welcome contributions from the community! Here's how you can help:
224
+
225
+ ### Reporting Issues
226
+
227
+ Please use GitHub issues to report bugs or request features.
228
+
229
+ ### Contributing Code
230
+
231
+ 1. Fork the repository
232
+ 2. Create a feature branch (`git checkout -b feature/my-feature`)
233
+ 3. Make your changes
234
+ 4. Ensure tests pass (`rake test`)
235
+ 5. Follow the code style (run `rubocop` if available)
236
+ 6. Commit your changes
237
+ 7. Push to your fork
238
+ 8. Open a pull request
239
+
240
+ ### Code Style
241
+
242
+ - Follow Ruby style guidelines
243
+ - Use meaningful variable and method names
244
+ - Add tests for new functionality
245
+ - Update documentation as needed
246
+
247
+ ### Testing
248
+
249
+ All contributions must include appropriate tests. Run the test suite with `rake test`.
250
+
251
+ ### Developer Certificate of Origin
252
+
253
+ By contributing to this project, you agree to the Developer Certificate of Origin (DCO). To certify your contribution, add a sign-off to your commits:
254
+
255
+ ```
256
+ git commit -s -m "Your commit message"
257
+ ```
258
+
259
+ This adds `Signed-off-by: Your Name <your.email@example.com>` to certify that you have the right to submit the work.
260
+
261
+ ## Reporting Defects
262
+
263
+ To report bugs or defects, please use GitHub issues at https://github.com/durableprogramming/abachrome/issues. Provide as much detail as possible, including:
264
+
265
+ - Steps to reproduce the issue
266
+ - Expected behavior
267
+ - Actual behavior
268
+ - Ruby version and gem version
269
+ - Any relevant code snippets
270
+
271
+ ## Security
272
+
273
+ For security-related issues, please contact us directly at commercial@durableprogramming.com instead of using public issues.
274
+
275
+ We take security seriously and will respond to vulnerability reports within 48 hours.
276
+
277
+ ## Governance
278
+
279
+ ### Project Members
280
+ - **Durable Programming**: Lead developer and maintainer (commercial@durableprogramming.com)
281
+
282
+ ### Roles and Responsibilities
283
+ - **Maintainer**: Responsible for code reviews, releases, and overall project direction
284
+ - **Security Contact**: Handles security vulnerability reports and coordinates responses
285
+
286
+ ### Sensitive Resources
287
+ Access to the following resources is limited to project maintainers:
288
+ - GitHub repository (push access)
289
+ - RubyGems publishing credentials
290
+ - CI/CD pipeline configurations
291
+
292
+ ### Contributor Permissions Policy
293
+
294
+ Before granting elevated permissions (write access, maintainer status):
295
+
296
+ 1. **Review Process**: Contributors must demonstrate consistent quality contributions over at least 3 months
297
+ 2. **Code Quality**: All contributions must follow project standards and pass CI checks
298
+ 3. **Security Review**: Security-related contributions receive additional scrutiny
299
+ 4. **Community Engagement**: Active participation in issue discussions and reviews
300
+ 5. **Maintainer Approval**: Final decision by existing maintainers via consensus
301
+
302
+ New contributors start with read-only access and issue reporting. Permissions are escalated gradually based on demonstrated responsibility.
303
+
304
+ # Acknowledgement
305
+
306
+ We'd like to thank the excellent Color.js and culori color libraries, which helped inspire this project and
307
+ inform its design.
308
+
309
+ # Commercial Support
310
+
311
+ Commercial support for this tool is available from Durable Programming, LLC. You can find out more at [durableprogramming.com](https://durableprogramming.com/) or via email at [commercial@durableprogramming.com](mailto:commercial@durableprogramming.com).
312
+
313
+ # Copyright
314
+
315
+ Copyright 2025, Durable Programming LLC. All rights reserved.
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create do |t|
7
+
8
+ t.test_prelude = %(require "simplecov"; SimpleCov.start { add_filter %p }) % ['/test/']
9
+ t.test_globs = FileList["test/**/*_test.rb", 'test/**/test_*.rb']
10
+ t.framework = %(require "test/test_helper.rb")
11
+ end
12
+
13
+
14
+ task default: :test
15
+
data/SECURITY.md ADDED
@@ -0,0 +1,94 @@
1
+ # Security Policy
2
+
3
+ ## Reporting Vulnerabilities
4
+
5
+ If you discover a security vulnerability in Abachrome, please report it to us as follows:
6
+
7
+ ### Contact
8
+ Email: security@durableprogramming.com
9
+
10
+ ### Response Time
11
+ We will acknowledge receipt of your report within 72 hours and provide a more detailed response within 7 days indicating our next steps.
12
+
13
+ ### Disclosure
14
+ We ask that you do not publicly disclose the vulnerability until we have had a chance to address it. We will work with you to determine an appropriate disclosure timeline.
15
+
16
+ ## Vulnerability Management
17
+
18
+ ### Classification
19
+ Vulnerabilities are classified as:
20
+ - **Critical**: Immediate threat to user data or system security
21
+ - **High**: Significant security risk
22
+ - **Medium**: Moderate security concern
23
+ - **Low**: Minor security issue
24
+
25
+ ### Remediation Timeline
26
+ - **Critical**: Within 48 hours
27
+ - **High**: Within 7 days
28
+ - **Medium**: Within 30 days
29
+ - **Low**: Within 90 days
30
+
31
+ ### Process
32
+ 1. Report received and acknowledged
33
+ 2. Assessment and classification
34
+ 3. Development of fix
35
+ 4. Testing and validation
36
+ 5. Release of patched version
37
+ 6. Public disclosure (if applicable)
38
+
39
+ ## Automated Security Scanning
40
+
41
+ ### SCA (Software Composition Analysis)
42
+ - **Tool**: bundle-audit
43
+ - **Frequency**: Run on all CI builds and weekly scheduled scans
44
+ - **Threshold**: All vulnerabilities must be addressed before release
45
+ - **Policy**: Critical and High severity vulnerabilities must be fixed immediately. Medium severity within 30 days. Low severity tracked but may be accepted with risk assessment.
46
+
47
+ ### SAST (Static Application Security Testing)
48
+ - **Tool**: Brakeman
49
+ - **Frequency**: Run on all CI builds
50
+ - **Threshold**: All warnings must be reviewed. High-confidence findings must be fixed. False positives documented.
51
+ - **Policy**: Security findings block releases. Code review required for waivers.
52
+
53
+ ### Dependency Updates
54
+ - **Process**: Automated PRs for patch updates. Manual review for minor/major updates.
55
+ - **Testing**: Full test suite run on dependency updates.
56
+ - **Rollback**: Ability to rollback if issues discovered post-update.
57
+
58
+ ## Security Updates
59
+ Security updates will be released as patch versions with descriptive changelogs. Subscribe to releases on GitHub to stay informed.
60
+
61
+ ## Verifying Releases
62
+
63
+ To ensure the integrity and authenticity of Abachrome releases:
64
+
65
+ 1. **Checksum Verification**: Each release includes SHA256 checksums for all assets. Download the checksum file and verify using:
66
+ ```
67
+ sha256sum -c abachrome-<version>.gem.sha256
68
+ ```
69
+
70
+ 2. **Signature Verification** (future): Releases will be signed with GPG. Verify using:
71
+ ```
72
+ gpg --verify abachrome-<version>.gem.asc abachrome-<version>.gem
73
+ ```
74
+
75
+ 3. **Source Verification**: Always build from the official GitHub repository source.
76
+
77
+ ## Support and Maintenance
78
+
79
+ ### Support Scope
80
+ Abachrome provides support for:
81
+ - Current stable Ruby versions (3.0+)
82
+ - Reported security vulnerabilities
83
+ - Critical bugs affecting core functionality
84
+
85
+ ### Support Duration
86
+ - **Active Support**: Latest major version receives full support
87
+ - **Security Support**: Versions receive security updates for 1 year after release
88
+ - **End of Life**: Versions without security support are documented in release notes
89
+
90
+ ### Security Update Policy
91
+ Security updates are provided for the current major version and the previous major version for up to 1 year after the new major version's release. Older versions may receive critical security fixes at our discretion.
92
+
93
+ ## Current Known Vulnerabilities
94
+ None at this time.
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/abachrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "abachrome-float"
7
+ spec.version = Abachrome::VERSION
8
+ spec.authors = ["Durable Programming"]
9
+ spec.email = ["commercial@durableprogramming.com"]
10
+
11
+ spec.summary = "A Ruby gem for parsing, manipulating, and managing colors"
12
+ spec.description = "Abachrome provides a robust set of tools for working with various color formats including hex, RGB, HSL, and named colors. Features support for multiple color spaces (RGB, HSL, Lab, Oklab), color space conversion, gamut mapping, CSS color parsing and formatting, and native float-based color calculations."
13
+ spec.homepage = "https://github.com/durableprogramming/abachrome-float"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 3.0.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/durableprogramming/abachrome-float"
19
+ spec.metadata["changelog_uri"] = "https://github.com/durableprogramming/abachrome-float/blob/main/CHANGELOG.md"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ (File.expand_path(f) == __FILE__) ||
26
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
27
+ end
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
+
32
+ # Runtime dependencies
33
+ spec.add_dependency "dry-inflector", "~> 1.0"
34
+
35
+ end
36
+