\n{$colorNames_CAPTION}\n\n\n\n\n"); $upperCellCount = 0; $lowerCellCount = 0; $upperIdCount = 1; $lowerIdCount = 1; if ($sort=="az") { $fileColorNames = fopen("incl/colnames_az.csv","r"); } else { $fileColorNames = fopen("incl/colnames_val.csv","r"); } while (!feof($fileColorNames)) { $nameRowLower = array(); $codeRowLower = array(); for ($j=0;$j<4;$j++) { $colorValues1 = fgetcsv($fileColorNames,128); $nameRowUpper = $colorValues1[0]; $codeRowUpper = $colorValues1[1]; array_push($nameRowLower, $nameRowUpper); array_push($codeRowLower, $codeRowUpper); $upperCellCount++; /* [OUTPUT UPPER TABLE CELL] */ echo ( "" . $nameRowUpper . "
" . $codeRowUpper . "\n" ); /* [/OUTPUT UPPER TABLE CELL] */ if ($upperCellCount%4==0) { echo ("\n"); } } // end of for loop for upper row /*____________________________________________________________________________*/ for ($k=0;$k<4;$k++) { $lowerCellCount++; $nameValue = str_replace("*","",$nameRowLower[$k]); //deleting star for integration into css and html color code /* [SETTING FONT COLOUR] */ $hexValue = $codeRowLower[$k]; $ValueR = hexdec(substr($hexValue,0,2)); $ValueG = hexdec(substr($hexValue,2,2)); $ValueB = hexdec(substr($hexValue,4,2)); $i = $ValueR + $ValueG + $ValueB; if (($i<287)&&($i!=255)) { $font = " style=\"color:#fff\""; } else { $font = ""; } /* [/SETTING FONT COLOUR] */ /* [OUTPUT LOWER TABLE CELLS] */ if ($lowerCellCount<=184) { echo ( "CSS" . "HTML\n" ); } /* [OUTPUT LOWER TABLE CELLS] */ if (($lowerCellCount%4==0)&&($lowerCellCount<184)) { echo "\n"; } } //end of for loop } //end of while loop fclose($fileColorNames); unset ($upperCellCount,$lowerCellCount,$upperIdCount,$lowerIdCount,$hexValue,$nameValue,$i); echo ("\n"); /* [/COLOUR NAMES CHART] */ /*============================================================================*/ ?>