chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty, vendored at upstream commit 91fb38a without its git history.
This commit is contained in:
commit
7e7d249099
1134 files changed
+433629
No files matched your search
@@ -0,0 +1,17 @@
|
||||
// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
|
||||
|
||||
package at
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func parse_opacity(arg string) (float64, error) {
|
||||
ans, err := strconv.ParseFloat(arg, 64)
|
||||
if err != nil || math.IsNaN(ans) {
|
||||
return 0, fmt.Errorf("Invalid opacity %#v: must be a number between 0 and 1", arg)
|
||||
}
|
||||
return max(0, min(ans, 1)), nil
|
||||
}
|
||||
Reference in new issue
Block a user