POV-Ray : Newsgroups : povray.binaries.utilities : New version of Farger.inc Server Time
4 May 2024 11:16:17 EDT (-0400)
  New version of Farger.inc (Message 17 to 26 of 40)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Melody
Subject: Re: New version of Farger.inc
Date: 22 Jan 2020 08:10:00
Message: <web.5e2848e3f66b17949da690110@news.povray.org>
Here's the last function to replace.
Returns the hue color you click, POV color 0-1;

function colorhue(i) {
  var z = 320;
  var v = .3 + .12 * i / z;
  var h = 1.0 - ((i % z) / z);
  if (i < 960) return "<"+roundv(hsv2rgb(h,1,v),6)+">";
  v = .33 + .12 * (i%960) / z;
  return "<"+roundv(hsl2rgb(h,1,v),6)+">";
}


Post a reply to this message

From: Melody
Subject: Re: New version of Farger.inc
Date: 22 Jan 2020 08:55:01
Message: <web.5e28532ef66b17949da690110@news.povray.org>
Here's the whole thing if u don't want to DIY.
Added 1920 unique names for the hue colors.
Maybe it's done now, always something else.


Post a reply to this message


Attachments:
Download 'povcolorselect4.zip' (35 KB)

From: Bald Eagle
Subject: Re: New version of Farger.inc
Date: 22 Jan 2020 15:50:00
Message: <web.5e28b4f3f66b17944eec112d0@news.povray.org>
So, this is very cool - most especially since it runs in JS, which is fast,
real-time, and runs in a browser.

This would be a great cross-platform pigment-map editor if JS has easily
editable sliders or something like that.  No clunky OS-dependent installation,
nearly everyone always has a browser window of some sort open...



Such a thing would be especially useful for constructing the pigment_maps for
patterns, since it's a hard thing to visualize, code, edit, and iteratively
render until it's "right"/pleasing.

http://news.povray.org/povray.binaries.images/thread/%3C5acf08bc%241%40news.povray.org%3E/

or for spitting out a prototype pigment_map for something sampled from an image,
that could them be fine-tuned and adjusted.

http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=41


Post a reply to this message

From: Melody
Subject: Re: New version of Farger.inc
Date: 23 Jan 2020 01:15:00
Message: <web.5e293923f66b17949da690110@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> So, this is very cool - most especially since it runs in JS, which is fast,
> real-time, and runs in a browser.
>
> This would be a great cross-platform pigment-map editor if JS has easily
> editable sliders or something like that.  No clunky OS-dependent installation,
> nearly everyone always has a browser window of some sort open...
>
>
>
> Such a thing would be especially useful for constructing the pigment_maps for
> patterns, since it's a hard thing to visualize, code, edit, and iteratively
> render until it's "right"/pleasing.
>
>
http://news.povray.org/povray.binaries.images/thread/%3C5acf08bc%241%40news.povray.org%3E/
>
> or for spitting out a prototype pigment_map for something sampled from an image,
> that could them be fine-tuned and adjusted.
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=41

Dream realized - Java is the cross platform solution.
Well if you like that, here's more.
Added 4 JS color pickers.

Firefox 25, no clipboard, but everything else is fine.
Latest Chrome, everything fine.I'll post an image, and this url.
color pickers not using clipboard ... displays 3 forms on the BGcolor.
I think it needs a switch to turn clipboard on off maybe.


Post a reply to this message


Attachments:
Download 'povcolorselect5.zip' (49 KB)

From: Melody
Subject: Re: New version of Farger.inc
Date: 23 Jan 2020 02:15:00
Message: <web.5e294758f66b17949da690110@news.povray.org>
Default off til you need it,
Cb<input type="checkbox" id="clip"/>

And in the function buffer ... there are 2,
which use clipboard();

if (document.getElementById("clip").checked) clipboard();


Post a reply to this message

From: Melody
Subject: Re: New version of Farger.inc
Date: 23 Jan 2020 07:15:00
Message: <web.5e298cd7f66b17949da690110@news.povray.org>
* my 3 global hacks = pickeropen = 1;pickeropen = 0;MYColor = '#'+value;
(Didn't figure a way to access existing state.)

Now it knows what it's doing on top of another layer.
Wont be pulling off uncontrolled double operations.
Was like insulting, heh.


Post a reply to this message


Attachments:
Download 'povcolorselect6.zip' (87 KB)

From: Melody
Subject: Re: New version of Farger.inc
Date: 23 Jan 2020 08:00:00
Message: <web.5e29985ef66b17949da690110@news.povray.org>
so you open and close a picker but didn't set a color. MYColor (not the other 4)
got set anyway, field will be changed unnecessarily for other upClicks.
 more changes...

function mouseUp(e) {
  if (pickeropen) showpicker();
}

function showpicker() {
  if ((MYColor) && (pickeropen)) { /// will move, not set.
}
function mouseDwn() {
  // echo(" ");
}

I mean, if you want something right.
That should be all the bugs from adding 4 pickers that can work on top.

happy coloring.


Post a reply to this message

From: Melody
Subject: Re: New version of Farger.inc
Date: 23 Jan 2020 09:45:01
Message: <web.5e29b088f66b17949da690110@news.povray.org>
too many changes to list,
text area (good for debugging)
color doesn't change without breaking a leg to do it.

changed to text input.
dark color with white text,
light colr with black text.

and all previous changes,
lucky number 7 is here.


Post a reply to this message


Attachments:
Download 'povcolorselect7.zip' (87 KB)

From: Melody
Subject: Re: New version of Farger.inc
Date: 23 Jan 2020 10:40:00
Message: <web.5e29bdc2f66b17949da690110@news.povray.org>
function hsl2rgb(h, s, l) {
....
  echo("That was not a color! hsl2rgb()")
  return [0,0,0];
}

both those functions ought to,
not leave a condition where it could return nothing.
check for out of range input.
and give some heads up.

more to do.


Post a reply to this message

From: Melody
Subject: Re: New version of Farger.inc
Date: 24 Jan 2020 07:40:01
Message: <web.5e2ae51bf66b17949da690110@news.povray.org>
v.8 Changes

comments removed from operations that need speed.
hue error handling.
added variables for decimal output.
clipboard extended to any color set with "Cb" checked.
but unfortunately,
copy event closes the jsPicker layer by focus change. not a bug.
should be clipboard("text")! mirc has it. another case for DIY.
clipboard had to select text. added deselect.

send palette color to Picker,
left mouseClick and ctr = 1, shift = 2, alt = 3rd Picker.

QUIRKS that stick:
open/close/reopen Picker before it gets the new color.

open a Picker, by clicking on text input ...
open another Picker, MYColor is set to previous picker.
 close and reopen same, set to this color.
  down clicks on Picker always set this color.


Post a reply to this message


Attachments:
Download 'povcolorselect8.zip' (89 KB)

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.