diff options
author | Joris | 2020-08-08 12:49:03 +0200 |
---|---|---|
committer | Joris | 2020-08-08 12:49:03 +0200 |
commit | 081e6aae57719c15bdbc5e973ca7ddba9506a4bb (patch) | |
tree | a8de15bb4165639cf283bde7b7e63eb330e83d88 /src/Color.ml | |
parent | 4ee0dfae75fda3a8b6347d55c728b50ce5c210d9 (diff) |
Show context menu to add, modify and delete markers
Diffstat (limited to 'src/Color.ml')
-rw-r--r-- | src/Color.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Color.ml b/src/Color.ml index b3d2f91..d2f74c4 100644 --- a/src/Color.ml +++ b/src/Color.ml @@ -27,10 +27,10 @@ let contrast_ratio (c1: rgb) (c2: rgb) = let from_raw color = let get_opt = function | Some x -> x | None -> raise (Invalid_argument "Option.get") in let div = H.div [| HA.style ("color: " ^ color) |] [| |] in - let body = Document.querySelectorUnsafe "body" in - let () = Element.appendChild body div in + let body = Document.query_selector_unsafe "body" in + let () = Element.append_child body div in let rgb = [%raw {| window.getComputedStyle(div).color |}] in - let () = Element.removeChild body div in + let () = Element.remove_child body div in let xs = Js.String.split ", " (get_opt (Js.String.splitByRe [%re "/[()]/"] rgb).(1)) in { r = Js.Float.fromString xs.(0) ; g = Js.Float.fromString xs.(1) |