This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ram [start length & {:keys [paged-in bank tag] | |
:or {paged-in false | |
bank 0}}] | |
;; I want to check here if :tag was added or not. But also i don't want to because style | |
(make-memory start length paged-in bank :text (vec (replicate length 0)) :writable true)) | |
(defn- make-memory [start length paged-in bank & {:keys [text writable tag]}] | |
;; TODO: Maybe check that length and end - start are the same; fill with zeros if not. | |
{:start start | |
:end (+ start length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (hsv-to-rgb hue saturation value) | |
(let* ([C (* saturation value)] | |
[A (abs (- (modulo (/ hue 60) 2) | |
1))] | |
[X (* (- 1 A))] | |
[m (- value C)] | |
[rgb-prime | |
(cond | |
[(<= 0 hue 59) `(,C ,X 0)] | |
[(<= 60 hue 119) `(,X ,C 0)] |
OlderNewer