Skip to content

color 2.0 is coming #79

@halostatue

Description

@halostatue

I noticed that in libui.rb you are using the Color library. I have published a prerelease version of Color 2.0 which has several backwards incompatibilities. You have used pessimistic versioning, so you won't be affected by Color 2.0 by default.

color = Color::RGB.extract_colors(value).first

This will be unchanged with the Color 2.0 release as it will automatically require color/rgb/colors when RGB#extract_colors is called.

def x11_colors
require 'color'
Color::RGB.constants.reject {|c| c.to_s.upcase == c.to_s}.map(&:to_s).map(&:underscore).map(&:to_sym)
end

This will need to be changed with Color 2.0 to require color/rgb/colors. To be backwards compatible (if you choose to support Color 2.0), you will need to require both color and color/rgb/colors. In 1.8, requiring color/rgb/colors will be a no-op. In 2.0 it will not. If you want to switch entirely to Color 2.0, color/rgb/colors is all you require, since it now requires color.

The other piece which may impact your choice to upgrade or not is that Color 2.0 is Ruby 3.2+ only as it uses Data classes for the color object definitions now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions