Skip to content

Fix building on case insensitive filesystems. #22

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 13, 2023
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
8 changes: 4 additions & 4 deletions notebooks/color.clj
Original file line number Diff line number Diff line change
Expand Up @@ -448,17 +448,17 @@ c/colorspaces-list

;; ### Polar coordinates

;; For every luma based color space you can create polar representation with `to-lch` or `from-lch`. Some of the colorspace are already predefined.
;; For every luma based color space you can create polar representation with `to-luma-color-hue` or `from-luma-color-hue`. Some of the colorspace are already predefined.

;; The following two are the same:

(c/to-lch c/to-LUV [20 30 100])
(c/to-luma-color-hue c/to-LUV [20 30 100])
(c/to-LCHuv [20 30 100])

;; Let's make LCH out of YUV.

(def yuv-polar (c/to-lch c/to-YUV [20 30 100]))
(c/from-lch c/from-YUV yuv-polar)
(def yuv-polar (c/to-luma-color-hue c/to-YUV [20 30 100]))
(c/from-luma-color-hue c/from-YUV yuv-polar)

;; You can create conversion pair by calling `make-LCH` function.

Expand Down
24 changes: 12 additions & 12 deletions src/clojure2d/color.clj
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@

;;

(defn to-lch
(defn to-luma-color-hue
"For given color space return polar representation of the color"
^Vec4 [to c]
(let [^Vec4 cc (to c)
Expand All @@ -909,7 +909,7 @@
C (m/hypot-sqrt (.y cc) (.z cc))]
(Vec4. (.x cc) C Hd (.w cc))))

(defn from-lch
(defn from-luma-color-hue
"For given color space convert from polar representation of the color"
^Vec4 [from c]
(let [^Vec4 c (pr/to-color c)
Expand All @@ -921,7 +921,7 @@
(defn to-Oklch
"RGB -> Oklch"
^Vec4 [c]
(to-lch to-Oklab c))
(to-luma-color-hue to-Oklab c))

(defn to-Oklch*
"RGB -> Oklch, normalized"
Expand All @@ -935,7 +935,7 @@
(defn from-Oklch
"Oklch -> RGB"
^Vec4 [c]
(from-lch from-Oklab c))
(from-luma-color-hue from-Oklab c))

(defn from-Oklch*
"Oklch -> RGB, normalized"
Expand Down Expand Up @@ -1768,7 +1768,7 @@
* H: 0.0 - 360.0"
{:metadoc/categories meta-conv}
^Vec4 [c]
(to-lch to-LAB c))
(to-luma-color-hue to-LAB c))

(defn to-LCH*
"RGB -> LCH, normalized"
Expand All @@ -1786,7 +1786,7 @@
For ranges, see [[to-LCH]]."
{:metadoc/categories meta-conv}
^Vec4 [c]
(from-lch from-LAB c))
(from-luma-color-hue from-LAB c))

(defn from-LCH*
"LCH -> RGB, normalized"
Expand All @@ -1810,7 +1810,7 @@
* H: 0.0 - 360.0"
{:metadoc/categories meta-conv}
^Vec4 [c]
(to-lch to-LUV c))
(to-luma-color-hue to-LUV c))

(defn to-LCHuv*
"RGB -> LCHuv, normalized"
Expand All @@ -1828,7 +1828,7 @@
For ranges, see [[to-LCH]]."
{:metadoc/categories meta-conv}
^Vec4 [c]
(from-lch from-LUV c))
(from-luma-color-hue from-LUV c))

(defn from-LCHuv*
"LCHuv -> RGB, normalized"
Expand Down Expand Up @@ -2262,7 +2262,7 @@
* H: 0.0 - 360.0"
{:metadoc/categories meta-conv}
^Vec4 [c]
(to-lch to-JAB c))
(to-luma-color-hue to-JAB c))

(defn to-JCH*
"RGB -> JCH, normalized"
Expand All @@ -2280,7 +2280,7 @@
For ranges, see [[to-JCH]]."
{:metadoc/categories meta-conv}
^Vec4 [c]
(from-lch from-JAB c))
(from-luma-color-hue from-JAB c))

(defn from-JCH*
"JCH -> RGB, normalized"
Expand Down Expand Up @@ -3508,8 +3508,8 @@
"Create LCH conversion functions pair from any luma based color space. "
[cs]
(let [[to from] (colorspaces cs)]
[(partial to-lch to)
(partial from-lch from)]))
[(partial to-luma-color-hue to)
(partial from-luma-color-hue from)]))

(defn complementary
"Create complementary color. Possible colorspaces are:
Expand Down