Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 13.15.2 #531

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/images/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Changelog

### [13.15.0](https://kaos.sh/ek/13.15.1)
### [13.15.2](https://kaos.sh/ek/13.15.2)

- `[color]` Improved named colors support

### [13.15.1](https://kaos.sh/ek/13.15.1)

- `[options]` Added method `Argument.Uint64`
- `[options]` Return type of method `Argument.Uint` set from `uint64` to `uint`
Expand Down
9 changes: 5 additions & 4 deletions color/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"fmt"
"math"
"strconv"
"strings"

"github.com/essentialkaos/ek/v13/mathutil"
)
Expand Down Expand Up @@ -59,8 +60,8 @@ type HSL struct {

// ////////////////////////////////////////////////////////////////////////////////// //

// colors is colors keywords
var colors = map[string]uint32{
// named is a map of named colors
var named = map[string]uint32{
"aliceblue": 0xf0f8ff,
"antiquewhite": 0xfaebd7,
"aqua": 0x00ffff,
Expand Down Expand Up @@ -416,8 +417,8 @@ func (c HSL) GoString() string {

// Parse parses color
func Parse(c string) (Hex, error) {
if colors[c] != 0 {
return Hex{v: colors[c]}, nil
if named[strings.ToLower(c)] != 0 {
return Hex{v: named[strings.ToLower(c)]}, nil
}

if c != "" && c[0] == '#' {
Expand Down
2 changes: 1 addition & 1 deletion color/color_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var _ = Suite(&ColorSuite{})
// ////////////////////////////////////////////////////////////////////////////////// //

func (s *ColorSuite) TestParse(c *C) {
color, err := Parse("violet")
color, err := Parse("vIOlEt")
c.Assert(err, IsNil)
c.Assert(color.v, Equals, uint32(0xEE82EE))

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/essentialkaos/check v1.4.1
github.com/essentialkaos/depsy v1.3.1
github.com/essentialkaos/go-linenoise/v3 v3.6.1
golang.org/x/crypto v0.30.0
golang.org/x/crypto v0.31.0
golang.org/x/sys v0.28.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ package ek
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "13.15.1"
const VERSION = "13.15.2"
Loading