mirror of
https://github.com/fatih/color.git
synced 2024-11-24 08:02:14 +02:00
Merge pull request #203 from hyunsooda/nilcheck-added
[Test] Nil check added
This commit is contained in:
commit
d5c210ca2a
6
color.go
6
color.go
@ -405,6 +405,12 @@ func (c *Color) isNoColorSet() bool {
|
||||
|
||||
// Equals returns a boolean value indicating whether two colors are equal.
|
||||
func (c *Color) Equals(c2 *Color) bool {
|
||||
if c == nil && c2 == nil {
|
||||
return true
|
||||
}
|
||||
if c == nil || c2 == nil {
|
||||
return false
|
||||
}
|
||||
if len(c.params) != len(c2.params) {
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user