/usr/share/octave/site/m/octave-epstk/ebright.m is in octave-epstk 2.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | %%NAME
%% ebright - change brightness of colormap
%%
%%SYNOPSIS
%% newColormap=ebright(colormap,brightness[,colorChannel])
%%
%%PARAMETER(S)
%% colormap color table
%% brightness +/- brigthness in per cent
%% colorChannel vector of Channel; 1=red, 2=green, 3=blue
%% e.g. [1 3] = Channel red and blue
%% default=[1 2 3]
%% newColormap changed color table
%%
% written by stefan.mueller@fhr.fraunhofer.de (C) 2012
function newColormap= ebright (colormap,brightness,colorChannel)
if nargin <2 || nargin >3
eusage('newColormap = ebright(colormap,brightness[,colorChannel])');
end
if nargin<3
colorChannel=[1 2 3];
end
newColormap=colormap(:,colorChannel);
[rows cols]=size(newColormap);
newColormap=reshape(newColormap,rows*cols,1);
if brightness<0
if brightness<-100
brightness=-100;
end
a=1+brightness/100;
newColormap=newColormap*a;
else
if brightness>100
brightness=100;
end
a=brightness/100;
b=1-a;
newColormap=newColormap*b+a;
end
newColormap=reshape(newColormap,rows,cols);
colormap(:,colorChannel)=newColormap;
newColormap=colormap;
|