Melakukan generate "heatmap" dari merah ke hijau dengan skala yang dapat di atur

Overview

Heatmap-Generator-with-Scale-SC

Melakukan generate "heatmap" dari merah ke hijau dengan skala yang dapat di atur

How to Use

Gunakan value default agar sesuai ekspetasi, memodifikasinya akan merubah tujuan dasar implementasi warna.

min = minimal angka yang akan menjadi warna merah (value defaultnya 0).

max = maksimal angka yang akan menjadi warna hijau (value defaultnya 1).

Gunakan fungsi numberToColorHsl(choose_scale/max_scale, min, max) untuk output warna.

catatan: garis miring ('/') bukan atau, melainkan pembagi.

Example

<?php

require "heatmap.php";

// set scale by tuning below variable
$scale = 20;

$listcolor = '<ul>';
for ($i = 0; $i <= $scale; $i++) {
	$listcolor .= '<li style="background-color:' . numberToColorHsl($i / $scale, 0, 1) . '">' . $i . "</li>\n";
}
$listcolor .= '</ul>';

echo $listcolor;
?>

Preview

Priview!

Source

Dimodifikasi dan mendapat ide dari: https://stackoverflow.com/questions/35848025/php-red-to-green-rgb-color-heatmap

License

GNU General Public License v3.0

You might also like...
Laravel Package to generate CRUD Files using TALL Stack
Laravel Package to generate CRUD Files using TALL Stack

tall-crud-generator Laravel Package to generate CRUD Files using TALL Stack Requirements Make sure that Livewire is installed properly on your project

The package lets you generate TypeScript interfaces from your Laravel models.

Laravel TypeScript The package lets you generate TypeScript interfaces from your Laravel models. Introduction Say you have a model which has several p

Provides an object-oriented API to generate and represent UIDs.

Uid Component The UID component provides an object-oriented API to generate and represent UIDs. Resources Documentation Contributing Report issues and

This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Easily generate URLs to Minecraft avatars with the ability to switch between services

Minecraft Avatar URLs This library provides PHP utilities to generate URLs to Minecraft Avatars in different formats with the ability to easily change

Auto Generate laravel api Documentation
Auto Generate laravel api Documentation

Laravel Dark Documentation Generator 💥 You can create Documentation for your api easily by using this library Installation: Require this package with

This package provides a trait that will generate a unique uuid when saving any Eloquent model.

Generate slugs when saving Eloquent models This package provides a trait that will generate a unique uuid when saving any Eloquent model. $model = new

A laravel package to generate model hashid based on model id column.

Laravel Model Hashid A package to generate model hash id from the model auto increment id for laravel models Installation Require the package using co

A laravel package to generate class files from stub files.

Laravel Stub Generator A php laravel package to generate useable php files from given stub files . Installation Require the package using composer: co

Owner
null
Sebuah aplikasi file hosting sederhana yang berguna untuk menyimpan berbagai file

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Willy Ferry 2 Nov 25, 2021
Integrasi Payment Gateway Midtrans dengan Framework Laravel 8

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Martin Mulyo Syahidin 25 Dec 4, 2022
WIRECRUD 9 adalah aplikasi CRUD + Search sederhana yang dibuat menggukana Laravel 9 dan Livewire 2

WIRECRUD 9 adalah aplikasi CRUD + Search sederhana yang dibuat menggukana Laravel 9 dan Livewire 2. Demo bisa dilihat di YouTube Developow Terbuka jika ingin clone apliaksi sederhana ini untuk belajar, bisa ikuti cara-cara berikut ini.

DeveloPow 11 Nov 25, 2022
Aplikasi Berbasis Web Data Penjualan dengan Laravel 8

Membuat Aplikasi Berbasis Web Data Penjualan Menggunakan Laravel 8, Yang Bertujuan Untuk Presentasi Kepada Tester. Aplikasi Berbasis Web Data Penjualan dengan Laravel 8 adalah aplikasi yang berfungsi untuk melakukan pendataan barang.

BAGUS BUDI SATOTO 15 Dec 16, 2022
Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Jameson Lopp 28 Dec 19, 2022
Generate trends for your models. Easily generate charts or reports.

Laravel Trend Generate trends for your models. Easily generate charts or reports. Support us Like our work? You can support us by purchasing one of ou

Flowframe 139 Dec 27, 2022
Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Christoph Kempen 1.7k Dec 28, 2022
Generate and autoload custom Helpers, Builder Scope, Service class, Trait

laravel-make-extender Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory. Generate Service class

Limewell 30 Dec 24, 2022
A package to generate modules for a Laravel project.

Laravel Modular A package to generate modules for a Laravel project. Requirements PHP 7.4 or greater Laravel version 8 Installation Install using comp

DPTSI 5 Mar 16, 2022
Auto generate routes for Laravel Livewire components

livewire-auto-routes Auto generate routes for Laravel Livewire Components. Requirements Livewire 2 Laravel 8 php 8 Installation composer require tanth

Tina Hammar 19 May 11, 2022