Skip to content

Instantly share code, notes, and snippets.

View RobertSibek's full-sized avatar

Robert Sibek RobertSibek

  • Bad Mug Games
  • Frenstat pod Radhostem
View GitHub Profile
@callumlocke
callumlocke / rgb-colour-to-number.js
Created July 21, 2015 13:56
RGB colour to single decimal number
// convert three r,g,b integers (each 0-255) to a single decimal integer (something between 0 and ~16m)
function colourToNumber(r, g, b) {
return (r << 16) + (g << 8) + (b);
}
// convert it back again (to a string)
function numberToColour(number) {
const r = (number & 0xff0000) >> 16;
const g = (number & 0x00ff00) >> 8;
@Fweeb
Fweeb / lockview.py
Last active May 14, 2024 03:29
Blender add-on for exposing the 3D View's rotation locking feature
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of