Am I closer to being on the right track here?

L

Lauri Raittila

I can't remember the last time I built a palette by hand :) Most of the
software I use these days does pretty damn good colour reducing.

You can sometimes get much better results when you hand pick. Of course,
you need to know what you are doing, and it is not woth effort often.
I wrote a bunch of command line apps a long time ago to assist with building
palettes, I wonder if I can dig them up. Might be worth playing with again.

I was disappointed in GIMP2 palette thing, or maybe I just didn't know
how to use it. (It was maybe 5years since I hava done it last time...
used PhotoShop or PSP then...)

(Took me about 15minutes to build palette, most of the time used on
movin mouse around)
I haven't run into that, but it is probably the 16bit display thing?

Is there any way to know 16bit colors used? So called "websafe colors"
don't help...
 
N

Nik Coughin

Lauri said:
I was disappointed in GIMP2 palette thing, or maybe I just didn't know
how to use it. (It was maybe 5years since I hava done it last time...
used PhotoShop or PSP then...)

(Took me about 15minutes to build palette, most of the time used on
movin mouse around)

I haven't tried doing it like that, I've always just made my own .pal files.
Nice easy format, text file; header, number of colours, rows with an integer
for red, green and blue on each row seperated with spaces. Easy to
manipulate with a wide range of tools. Easy to read in and out of a custom
app. Easy to build a number of partial palettes and concatenate them into
one. I must try the GUI approach some time :)
Is there any way to know 16bit colors used? So called "websafe colors"
don't help...

Don't know sorry.
 
D

DaKitty

rf said:
DaKitty said:
to
do

Looking forward to that! :)

Turned out to be an almost trivial exercise. Here is a cut down version of
it:

Your pages looks something like this: (probably has to be called eg
page1.php)

<html>
<head>
... including a link to your .css file
</head>
<body>

<!-- navigation -->
<? require "navbar.php" ?>

<!-- rest of content for this page -->
<div class="content">
...
</div>
</body>
<html>

navbar.php looks like this:

<?
function menu($link,$text)
{
$llen = strlen($link);
$tlen = strlen($_SERVER['PHP_SELF']);
$t = substr($_SERVER['PHP_SELF'],$tlen - $llen,$llen);
if ($t === $link)
{
echo '<li><span>' . $text . "</span></li>\n";
}
else
{
echo '<li><a href="' . $link . '">' . $text . "</a></li>\n";
}
}

echo "<div class='nav'>\n";
echo "<ul>\n";

//insert menu calls for each nav link here. syntax is
// menu (page to link to,text to go on the page);

menu("page1.php","Page 1");
menu("page2.php","Page 2");
menu("page3.php","Page 3");

echo "</ul>\n";
echo "</div>\n";

?>

The function menu looks at the path of the page in the "link". If it is the
same as the last part of "this page" then a <span> gets output. If not then
an <a> gets output. You style these elements to your liking in your .css
file.

You can see a very minimal version of this hapenning here:
http://cueword.com.au/menu/page1.php
oh, neat!
Thanks for that. I saved the post and will look at it in more detail in
couple of days when I have time for some more of this... Real work getting
in the way! Pffft!
 
R

rf

Duende said:
Ok, I just tried Cheers Richard's menu code and it is as good as mine.

<grin>Thank you sir</grin>

I also notice that you might just get lost with those arrays of yours if
they get much larger, you know, having one out of sync with the other.

It may be better to initialize a two dimensional arrary, or at least an
arrary of two element arrays. That way you can have the target and the text
on one source line in the PHP, sort of like my function calls.

My example is also minimal. The real one does many more things, like adding
submenus if the menu item refers to the current page and adding other links
here and there, sometimes depending on stuff in the $_GET array.
 
D

Duende

While sitting in a puddle rf scribbled in the mud:
<grin>Thank you sir</grin>

I also notice that you might just get lost with those arrays of yours if
they get much larger, you know, having one out of sync with the other.

I know that! I also had a $title = array in there but that got to be to
much trouble.
It may be better to initialize a two dimensional arrary, or at least an
arrary of two element arrays. That way you can have the target and the
text on one source line in the PHP, sort of like my function calls.

My example is also minimal. The real one does many more things, like
adding submenus if the menu item refers to the current page and adding
other links here and there, sometimes depending on stuff in the $_GET
array.
So lets see your "real" one. I got to learn thes stuff somewhere.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top