Color picker component in Perspective

Hi

Just wanted to know if there is a color picker/selector component in the Perspective module.

No.

I’m not aware of plans to add one in the near future. Someone could provide a third party module in the meantime.

Oh alright, thanks.

Here is one on the exchange, I actually started a more robust one as well to add, just havent done it yet so who knows maybe one day!

6 Likes

Woah! will try using this component, thanks a lot!

So, I needed a color picker and tried the one from the exchange.
I thought it could be polished a bit more, and... I couldn't sleep last night anyway.

color_picker.zip (34.6 KB)
image

Not gonna lie, I stole the palette from the one @Travis.Cox made.
Also used his mechanism to write the colors part to the parameter (property change script on the r/g/b components.).
What changed, then ?
Internally, I tried to clean it up a bit, make things simpler. Rewrote the scripts to make them clearer.
Visually, The r/g/b/a components adapt to show what color you'll get by putting the slider handle somewhere. It's accurate enough.

I didn't test this on multiple browsers, so if you find something that behaves weirdly, please report back.
Also note that the css used to modify the slider's handle and bind it to its container might need to be adjusted if you change the size of the sliders (there's some padding involved to make it stay inside).
You'll find the handle's css in the color_slider_handle, as an injection,
and the css for the slider itself in color_slider

There's also an alpha part. The color returned won't include it (hex code still on 6 characters) if there's no transparency.

The popup expects a popup_id, an item_id and an initial color.
The popup_id is used to close the popup, and is provided automatically if you use the color_popup function.
item_id is used to filter the incoming messages, in case there are several things calling this popup.
Can be pretty much anything, as long as it identifies the component that should receive the message.
color is, well, an initial color, in case you need to change a color instead of creating a new one.
This could probably be improved, maybe just giving it a default color... I didn't need it so I didn't do it.

I might polish it some more when I get time, but this is good enough for my use case.

edit: Just realized it's missing a style class... that's in my actual project.
I'll try and fix this asap. And maybe also make things align a bit more neatly.

edit: forgot about this. Updated with slightly better looking version.

10 Likes

Hi there, I’m coming in pretty late to this thread, but this color picker is exactly what I’ve been looking for. I’m a relatively new Ignition Programmer. Is it okay to pretty much just copy and paste this into my own project? I’m not sure how usage rights work for this. I’d be more than happy to credit you in any way you’d like!

The exchange has specific rights grants. (Basically MIT-style open source.) You should read its terms.

1 Like

You can take mine, the download link is still active (in the post right above yours).
I should put it on the exchange but it just wouldn't work last time I tried...

Note that the one on the exchange was made by Travis Cox, so if you want to credit someone it should be him.

2 Likes