mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-14 23:43:01 -06:00
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.9 to 2.20.12 (#2509)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.20.9 to 2.20.12. - [Release notes](https://github.com/tdewolff/minify/releases) - [Commits](https://github.com/tdewolff/minify/compare/v2.20.9...v2.20.12) --- updated-dependencies: - dependency-name: github.com/tdewolff/minify/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
72d0f46b0b
commit
f0c3533862
11 changed files with 1911 additions and 19 deletions
47
vendor/github.com/tdewolff/parse/v2/css/util.go
generated
vendored
Normal file
47
vendor/github.com/tdewolff/parse/v2/css/util.go
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
package css
|
||||
|
||||
import "github.com/tdewolff/parse/v2"
|
||||
|
||||
// IsIdent returns true if the bytes are a valid identifier.
|
||||
func IsIdent(b []byte) bool {
|
||||
l := NewLexer(parse.NewInputBytes(b))
|
||||
l.consumeIdentToken()
|
||||
l.r.Restore()
|
||||
return l.r.Pos() == len(b)
|
||||
}
|
||||
|
||||
// IsURLUnquoted returns true if the bytes are a valid unquoted URL.
|
||||
func IsURLUnquoted(b []byte) bool {
|
||||
l := NewLexer(parse.NewInputBytes(b))
|
||||
l.consumeUnquotedURL()
|
||||
l.r.Restore()
|
||||
return l.r.Pos() == len(b)
|
||||
}
|
||||
|
||||
// HSL2RGB converts HSL to RGB with all of range [0,1]
|
||||
// from http://www.w3.org/TR/css3-color/#hsl-color
|
||||
func HSL2RGB(h, s, l float64) (float64, float64, float64) {
|
||||
m2 := l * (s + 1)
|
||||
if l > 0.5 {
|
||||
m2 = l + s - l*s
|
||||
}
|
||||
m1 := l*2 - m2
|
||||
return hue2rgb(m1, m2, h+1.0/3.0), hue2rgb(m1, m2, h), hue2rgb(m1, m2, h-1.0/3.0)
|
||||
}
|
||||
|
||||
func hue2rgb(m1, m2, h float64) float64 {
|
||||
if h < 0.0 {
|
||||
h += 1.0
|
||||
}
|
||||
if h > 1.0 {
|
||||
h -= 1.0
|
||||
}
|
||||
if h*6.0 < 1.0 {
|
||||
return m1 + (m2-m1)*h*6.0
|
||||
} else if h*2.0 < 1.0 {
|
||||
return m2
|
||||
} else if h*3.0 < 2.0 {
|
||||
return m1 + (m2-m1)*(2.0/3.0-h)*6.0
|
||||
}
|
||||
return m1
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue