What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-15 00:19:03
javascript rgb to hex
function rgbToHex(r, g, b) { return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); } function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); if(result){ var... Add solution -
Java 2021-09-14 19:48:03
Rotate Vector by an angle
var rotateVector = function(vec, ang) { ang = -ang * (Math.PI/180); var cos = Math.cos(ang); var sin = Math.sin(ang); return new Array(Math.round(10000*(vec[0] * cos - vec[1] * sin))/10000, Math.round(10000*(vec[0] * sin + vec[1] * cos))/1... Add solution
Best helpers
Ranking is empty