色卡作为一种预设工具,是自然界存在的颜色在某种材质上的体现,主要用于色彩选择、比对、沟通,是色彩实现在一定范围内统一的标准。目前市面上的色卡种类有很多,但是常用的又有那些呢 ?
常用色卡的种类:
色卡的种类有很多,不同的行业都有属于自己的标准色卡,但是色卡的种类到底有多少,没人详细统计过。常用的标准色卡品牌有美国的潘通色卡(PANTONE)、德国劳尔色卡(RAL)、瑞典的NCS色卡、日本DIC色卡,国产的有ISO灰卡及中国建筑色卡等。
1.潘通色卡
Pantone色卡,提供平面设计、服装家居、涂料、印刷等行业专色色卡,是国际上广泛应用的色卡。
2.德国RAL色卡
也被叫做RAL国际色卡,这是一种转为色彩设计开发配色用色卡,如油漆、涂料调色配色领域,就常用RAL色卡。
3.瑞典的NCS色卡
NCS色卡是来自瑞典的色彩设计工具,是欧洲常用的标准色卡之一,全部颜色按照色相及黑度、百度和彩度规律有序排列,颜色查找会比较方便。
4.日本DIC色卡
DIE色卡是日本生产的配色工具,多用于工业、平面设计、包装、纸张印刷等领域的配色管理。
5.ISO灰卡
这是用于评估色拉度测试的专用色卡,例如纺织行业的色牢度评定,一般就会使用ISO灰卡来测试。
6.中国建筑色卡
这是中国比较权威的国家级建筑色彩标准,也是唯一用于建筑颜色的专用色卡,建筑领域的色彩设计、比对、沟通都会应用这款色卡。
学习内容:
- 色卡分享(本次运用到的颜色)
- 时钟(html)
- 时钟(JavaScript)
色卡分享(本次运用到的颜色):
学习产出:
1.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>M_fffz</title>
</head>
<body style="height:100%">
<canvas id="canvas" style="height:100%;width: 100%;background:black;">
当前浏览器不支持Canvas,请更换浏览器后再试
</canvas>
<script src="js/digit.js"></script>
<script src="js/countdown6.6.js"></script>
</body>
</html>
2.JavaScript
2.1 countdown6.6.js
var WINDOW_WIDTH = 1024;
var WINDOW_HEIGHT = 768;
var RADIUS = 8;
var MARGIN_TOP = 60;
var MARGIN_LEFT = 30;
//var endTime = new Date();
//endTime.setTime( endTime.getTime() + 3600*1000 )
var curShowTimeSeconds = 0
var balls = [];
const colors = [
"rgb(161,212,189)",
"rgb(117,142,97)",
"rgb(98,190,157)",
"rgb(71,184,151)",
"rgb(23,128,105)",
"rgb(168,205,52)",
"rgb(23,111,88)",
"rgb(190,224,208)",
"rgb(33,166,117)",
"rgb(78,96,108)",
"rgb(30,127,168)"]
window.onload = function(){
WINDOW_WIDTH = document.body.clientWidth
WINDOW_HEIGHT = document.body.clientHeight
MARGIN_LEFT = Math.round(WINDOW_WIDTH /10);
RADIUS = Math.round(WINDOW_WIDTH * 4 / 5 / 108)-1
MARGIN_TOP = Math.round(WINDOW_HEIGHT /5);
var canvas = document.getElementById('canvas');
var context = canvas.getContext("2d");
canvas.width = WINDOW_WIDTH;
canvas.height = WINDOW_HEIGHT;
curShowTimeSeconds = getCurrentShowTimeSeconds()
setInterval(
function(){
render( context );
update();
}
,
50
);
}
function getCurrentShowTimeSeconds() {
var curTime = new Date();
var ret = curTime.getHours() * 3600 + curTime.getMinutes() * 60 + curTime.getSeconds();
return ret;
}
function update(){
var nextShowTimeSeconds = getCurrentShowTimeSeconds();
var nextHours = parseInt( nextShowTimeSeconds / 3600);
var nextMinutes = parseInt( (nextShowTimeSeconds - nextHours * 3600)/60 )
var nextSeconds = nextShowTimeSeconds % 60
var curHours = parseInt( curShowTimeSeconds / 3600);
var curMinutes = parseInt( (curShowTimeSeconds - curHours * 3600)/60 )
var curSeconds = curShowTimeSeconds % 60
if( nextSeconds != curSeconds ){
if( parseInt(curHours/10) != parseInt(nextHours/10) ){
addBalls( MARGIN_LEFT + 0 , MARGIN_TOP , parseInt(curHours/10) );
}
if( parseInt(curHours%10) != parseInt(nextHours%10) ){
addBalls( MARGIN_LEFT + 15*(RADIUS+1) , MARGIN_TOP , parseInt(curHours/10) );
}
if( parseInt(curMinutes/10) != parseInt(nextMinutes/10) ){
addBalls( MARGIN_LEFT + 39*(RADIUS+1) , MARGIN_TOP , parseInt(curMinutes/10) );
}
if( parseInt(curMinutes%10) != parseInt(nextMinutes%10) ){
addBalls( MARGIN_LEFT + 54*(RADIUS+1) , MARGIN_TOP , parseInt(curMinutes%10) );
}
if( parseInt(curSeconds/10) != parseInt(nextSeconds/10) ){
addBalls( MARGIN_LEFT + 78*(RADIUS+1) , MARGIN_TOP , parseInt(curSeconds/10) );
}
if( parseInt(curSeconds%10) != parseInt(nextSeconds%10) ){
addBalls( MARGIN_LEFT + 93*(RADIUS+1) , MARGIN_TOP , parseInt(nextSeconds%10) );
}
curShowTimeSeconds = nextShowTimeSeconds;
}
updateBalls();
console.log( balls.length)
}
function updateBalls(){
for( var i = 0 ; i < balls.length ; i ++ ){
balls[i].x += balls[i].vx;
var c = 1.0;
if( balls[i].y + RADIUS + balls[i].vy >= WINDOW_HEIGHT ){
c = ( WINDOW_HEIGHT - (balls[i].y+ RADIUS) ) / balls[i].vy;
console.log( c );
}
balls[i].y += balls[i].vy;
balls[i].vy += c * balls[i].g;;
if( balls[i].y >= WINDOW_HEIGHT-RADIUS ){
balls[i].y = WINDOW_HEIGHT-RADIUS;
balls[i].vy = - Math.abs(balls[i].vy)*0.75;
}
}
var cnt = 0
for( var i = 0 ; i < balls.length ; i ++ )
if( balls[i].x + RADIUS > 0 && balls[i].x -RADIUS < WINDOW_WIDTH )
balls[cnt++] = balls[i]
while( balls.length > cnt ){
balls.pop();
}
}
function addBalls( x , y , num ){
for( var i = 0 ; i < digit[num].length ; i ++ )
for( var j = 0 ; j < digit[num][i].length ; j ++ )
if( digit[num][i][j] == 1 ){
var aBall = {
x:x+j*2*(RADIUS+1)+(RADIUS+1),
y:y+i*2*(RADIUS+1)+(RADIUS+1),
g:1.5+Math.random(),
vx:Math.pow( -1 , Math.ceil( Math.random()*1000 ) ) * 4,
vy:-5,
color: colors[ Math.floor( Math.random()*colors.length ) ]
}
balls.push( aBall )
}
}
function render( cxt ){
cxt.clearRect(0,0,WINDOW_WIDTH, WINDOW_HEIGHT);
var hours = parseInt( curShowTimeSeconds / 3600);
var minutes = parseInt( (curShowTimeSeconds - hours * 3600)/60 )
var seconds = curShowTimeSeconds % 60
renderDigit( MARGIN_LEFT , MARGIN_TOP , parseInt(hours/10) , cxt )
renderDigit( MARGIN_LEFT + 15*(RADIUS+1) , MARGIN_TOP , parseInt(hours%10) , cxt )
renderDigit( MARGIN_LEFT + 30*(RADIUS + 1) , MARGIN_TOP , 10 , cxt )
renderDigit( MARGIN_LEFT + 39*(RADIUS+1) , MARGIN_TOP , parseInt(minutes/10) , cxt);
renderDigit( MARGIN_LEFT + 54*(RADIUS+1) , MARGIN_TOP , parseInt(minutes%10) , cxt);
renderDigit( MARGIN_LEFT + 69*(RADIUS+1) , MARGIN_TOP , 10 , cxt);
renderDigit( MARGIN_LEFT + 78*(RADIUS+1) , MARGIN_TOP , parseInt(seconds/10) , cxt);
renderDigit( MARGIN_LEFT + 93*(RADIUS+1) , MARGIN_TOP , parseInt(seconds%10) , cxt);
for( var i = 0 ; i < balls.length ; i ++ ){
cxt.fillStyle=balls[i].color;
cxt.beginPath();
cxt.arc( balls[i].x , balls[i].y , RADIUS , 0 , 2*Math.PI , true );
cxt.closePath();
cxt.fill();
}
}
function renderDigit( x , y , num , cxt ){
for( var i = 0 ; i < digit[num].length ; i ++ )
for(var j = 0 ; j < digit[num][i].length ; j ++ )
if( digit[num][i][j] == 1 ){
cxt.beginPath();
var radiaCrad=cxt.createRadialGradient(x+j*2*(RADIUS+1)+(RADIUS+1) ,y+i*2*(RADIUS+1)+(RADIUS+1) ,2, x+j*2*(RADIUS+1)+(RADIUS+1) ,y+i*2*(RADIUS+1)+(RADIUS+1) , RADIUS);
radiaCrad.addColorStop(0.0,"#ffffff");
radiaCrad.addColorStop(0.25,"#fff8a9");
radiaCrad.addColorStop(0.5,"rgb(232,241,46)");
radiaCrad.addColorStop(0.75,"rgb(255,238,66)");
radiaCrad.addColorStop(1.0,"rgb(250,239,40)");
cxt.fillStyle = radiaCrad;
cxt.lineWidth=3;
cxt.strokeStyle="#fff302";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0,0,0,0,1,1],
[0,0,0,0,0,1,1],
[0,0,0,0,0,1,1],
[0,0,0,0,0,1,1],
[1,1,0,0,0,1,1],
[0,1,1,1,1,1,0]
],//5
[
[0,0,0,0,1,1,0],
[0,0,1,1,0,0,0],
[0,1,1,0,0,0,0],
[1,1,0,0,0,0,0],
[1,1,0,1,1,1,0],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[0,1,1,1,1,1,0]
],//6
[
[1,1,1,1,1,1,1],
[1,1,0,0,0,1,1],
[0,0,0,0,1,1,0],
[0,0,0,0,1,1,0],
[0,0,0,1,1,0,0],
[0,0,0,1,1,0,0],
[0,0,1,1,0,0,0],
[0,0,1,1,0,0,0],
[0,0,1,1,0,0,0],
[0,0,1,1,0,0,0]
],//7
[
[0,1,1,1,1,1,0],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[0,1,1,1,1,1,0],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[0,1,1,1,1,1,0]
],//8
[
[0,1,1,1,1,1,0],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[1,1,0,0,0,1,1],
[0,1,1,1,0,1,1],
[0,0,0,0,0,1,1],
[0,0,0,0,0,1,1],
[0,0,0,0,1,1,0],
[0,0,0,1,1,0,0],
[0,1,1,0,0,0,0]
],//9
[
[0,0,0,0],
[0,0,0,0],
[0,1,1,0],
[0,1,1,0],
[0,0,0,0],
[0,0,0,0],
[0,1,1,0],
[0,1,1,0],
[0,0,0,0],
[0,0,0,0]
]//:
];
效果图:
本文含有隐藏内容,请 开通VIP 后查看